previous | start | next

Example: gets

The gets function will read an entire input line, including spaces and store them in its char array argument. A null byte will always be added to mark the end of the input string.

char s[120];

printf("Enter a sentence:\n");
gets(s);

Note that for an array like s, the actual parameter passed is also an address: the address of the first array element, s[0].



previous | start | next