Mail Archives: djgpp/2000/01/28/04:03:39
LarsNicolas wrote:
>
> Hello,
>
> When I tried to pass '...' (3 dots) to my program compiled in djgpp, something
> like:
>
> C:\>myprog ...
>
> Djgpp returns just a single dot in argv[]! When I tried passing 4 dots or 2
> dots, it is working fine...I don't know if this is a bug in my program or if
> has something to do with my operating system (Windows 98), but I will really
> appreciate if someone wil going to help me with this...Maybe this might be a
> bug in djgpp?...
>
> my code:
After turning your code into legal C, it echoes properly. The
particular reason for the behavior you report is a mystery to me, but I
don't often worry about the behavior of incorrect code.
#include <stdio.h> /* mha - printf is variadic; prototype
required */
int main(int argc, char **argv)
{
printf("%s\n", argv[1]); /* mha - added \n needed to make this
program
have defined behavior */
return 0;
} /* mha - illegal ';' removed */
> ------------------------
> int main(int argc, char **argv) {
> printf("%s", argv[1]);
> return 0;
> };
> ------------------------
>
> Thanks,
> Lars
--
Martin Ambuhl mambuhl AT earthlink DOT net
What one knows is, in youth, of little moment; they know enough who
know how to learn. - Henry Adams
A thick skin is a gift from God. - Konrad Adenauer
__________________________________________________________
Fight spam now!
Get your free anti-spam service: http://www.brightmail.com
- Raw text -