Friday, May 25, 2012

C Adventures

Strings in C is a problematic matter for novices like me. You usually see that your first guess is wrong and are puzzled until you discover the "C" way. The simple '=' operator does not work (except initialization) and you have to use the strcpy function. Below is an example where I assign the file's name to the variable fileName and then use it in fopen (source code here):

No comments: