Code::Blocks Forums
User forums => Help => Topic started by: 1439808922 on May 05, 2016, 10:30:09 am
Title:
No console output when debug with arguments
Post by:
1439808922
on
May 05, 2016, 10:30:09 am
int main(int argc,char *argv[])
{
for(int i=0;i<argc;i++)
printf("%s ",argv
);
return 0; -----breakponit
}
the above code has no console output .
But
int main(int argc,char *argv[])
{
int a;
for(int i=0;i<argc;i++)
printf("%s ",argv
);
scanf("%d",&a);
return 0;
}
does have output.
what should i do???
Title:
Re: No console output when debug with arguments
Post by:
1439808922
on
May 05, 2016, 10:38:07 am
it seems that i should fflush(stdout) manually when debugging with arguments????
Title:
Re: No console output when debug with arguments
Post by:
raynebc
on
May 05, 2016, 09:28:46 pm
In your loop, did you mean to do this instead (print each command line argument to console)?
Code
for(int i=0;i<argc;i++)
printf("%s ",argv[i]);
Title:
Re: No console output when debug with arguments
Post by:
1439808922
on
May 06, 2016, 06:02:19 am
yes