3 ms·
If I may add my two cents... I highly recommend reading through the standard library and then looking at how they are implemented in actual C. The string librar
by s_m_t 7y ago
If I may add my two cents...
I highly recommend reading through the standard library and then looking at how they are implemented in actual C. The string library is probably the most important, this is where most people mess up!
If you can figure out pointers and how to actually get the size of things (sizeof(*char) doesn't get you the size of what it is pointing at... it gets you the size of a pointer which varies depending on the architecture. sizeof(myArray) doesn't give you the number of elements in an array, it gives you the number of bytes your array can hold, to get the number of elements you must do sizeof(myarray)/sizeof(myarray[0]). sizeof() is a compile-time operator, it knows nothing of runtime) you will be pretty much 99% of the way there.
https://en.cppreference.com/w/c/string/byte https://en.cppreference.com/w/c/string/byte
https://github.com/lattera/glibc/tree/master/string https://github.com/lattera/glibc/tree/master/string