Putting our variables into a structure

In this lesson:
  • Introduction to structures
  • putting our variables into the struct
Running time: 14:00
 
 

Comments (2)

 

The string copy goes character-by-character, filling up the variable array with what is in the string. For instance:

char temp[10];

strcpy(temp,"test");

what happens here:

put 't' in temp[0];

put 'e' in temp[1];

put 's' in temp[2];

put 't' in temp[3];

put '\0' in temp[4];

 

the '\0' is the NULL character, which indicates the end of the string.

- John

yes Johnny it is nice! putting our variables into the struct!!! but i need what the sting copy actually do in the array? and better to add another functions also like string compare and others! Thank you Johnny!! it is good explanation i like it.