books

http://it-ebooks.info/

http://stackoverflow.com/questions/tagged/c%2b%2b?sort=votes&pageSize=15

Q: why processing sorted array is faster than un-sorted ones? A: branch prediction

Q: while(x- ->0)  is while( (x–) > 0 )

Q:

int arrary1[3] = { 1, 2, 3 };
int *p = nullptr;
p = arrary1;

printf(“%d\n”, p); // random number, address to int, overflow
printf(“%d\n”, p[0]); // 1
printf(“%d\n”, *(++p)); // 2
printf(“%d\n”, p[0]); // 2

Q: split string

std::vector<std::string> split(const std::string&s,char delim){
std::vector<std::string> elems;
split(s, delim, elems);
return elems;}

Q:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s