Home Page
About Us


`printf` is a common function for formatted output


The C standard library function, "strcpy()," is used to copy non-overlapping, null-terminated strings



Be also very careful with printf strcpy strcat .

from question  

C - Enter dead loop after trying to read line by line of a file and lines might contain space character?

Printf is more robust if you want to format your string;if you only want to concatenate use strncpy don t use strcpy since it s more efficient

from question  

Snprintf vs. strcpy (etc.) in C

I also recommend using printf rather than sequences of strcpy and strcat printf msg user s r n user

from question  

FTP Server strange response when trying to login

The latter might look like this you can use strcpy and strcat instead if you prefer but in this particular case i think printf is clearer and cleaner

from question  

How to properly pass file path with from the command line?

At first glance it must be significantly faster because strcpy must be significantly faster than printf

from question  

Sprintf vs strcpy - use more memory and fast copy or almost no memory and slow copy?

Back to Home
Data comes from Stack Exchange with CC-BY-SA-4.0