Lecture11 C String Functions
Lecture11 C String Functions
string functions
String Input Function: gets()
The gets() function is useful for interactive programs.
It reads characters from the keyboard until it reaches a newline character
(\n).
Example
#include <stdio.h>
#include <string.h>
int main(void)
{
char caName[100];
#include <stdio.h>
#define STRDEF "I am a #defined string"
int main(void)
{
static char str1[] = "An array was initialised to
me.";
#include <stdio.h>
int main (void)
{
char ch;
len = strlen(NAME);
printf("The length of string %s is %d\n", NAME, len);
}//main