Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

string text line

#include <stdio.h>
//You can use the fgets() function to read a line of string. 
//you can use puts() to display the string.
//to solve spacing problem in scanf()
int main()
{
    char name[30];
    printf("Enter name: ");
    fgets(name, sizeof(name), stdin);  // read string
    printf("Name: ");
    puts(name);    // display string
    return 0;
}
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #string #text #line
ADD COMMENT
Topic
Name
1+8 =