Friday, January 25, 2013

feel amazed from puts(char*)

Before I took this class and use C++, I didn't even think what happened in memory when I did something.

For example, I just "understood" about puts(char * S). I knew that puts will print string buffer to the standard output start from address S until it finds \0. I thought \0 should be the end of the S specified from the number of array char who calls puts. But it doesn't. Apparently, it will check through the whole memory until it finds the value of that address is 0. So keep tracking the memory is very important.

Just by understanding that simple thing I felt amazed. I think I should start from the beginning of C++ and really understand it.

No comments:

Post a Comment