C code
- From: "Bill Cunningham" <nospam@xxxxxxxxx>
- Date: Sun, 11 Nov 2007 23:51:57 GMT
Richard can you or anyone else tell me what's wrong with this code. It's
just a simple error I'm sure.
#include <stdio.h>
int main(int argc,char *argv[]){
char name[]="Enter Code -> ";
printf("%s",&name);
fflush(stdout);
char input[40];
scanf("%s",&input);
printf("%s",&input);}
Now if I enter something like niceday it is printed but nice day then only
nice is printed. The space is the question. Is it scanf or printf's string
literal in those functions?
Bill
.
- Follow-Ups:
- Re: C code
- From: Keith Thompson
- Re: C code
- From: Default User
- Re: C code
- From: Flash Gordon
- Re: C code
- Prev by Date: Re: Time and memory performance of C versus C++
- Next by Date: Re: I cant do change string to int.
- Previous by thread: Typedef question
- Next by thread: Re: C code
- Index(es):
Relevant Pages
|