Twitter Update

Enter the data string with spaces [C]


After a long search ... See also how. enter the data string with spaces by using the function gets. This gets to read 1 line, so different from scanf.
This is the code :


#include<stdio.h>
#include<conio.h>
void main()
{
    char nama[20];
    printf("Input name : ");
    gets(nama); //untuk membaca line menggunakan gets
    printf("\n%s",nama);
    getch();
}

Hopefully can help :)


0 comments:

Post a Comment

ABOUT ME

IP
Albert Julius. Powered by Blogger.
Copyright © Albert'Blog