read word on terminal?
i have c code (mycode.c) like this :
#include<stdio.h>
int main()
{
printf("word\n");
return 0;
}
when i execute them, so the terminal is look like :
#./mycode
word
i want to get "word" in terminal into get_word.c.
#include<stdio.h>
int main()
{
char *word_from_terminal;
word_from_terminal = ............ /*this variable is refers to word in terminal*/
printf("%s\n",word_from_terminal);
return 0;
}
the output of get_word is :
#./get_word
word
would you tell me what is code in .......... like?
thank's
Last edited by khucinx; 06-09-2004 at 06:45 AM.
|