[NTLUG:Discuss] OT C question

Chris Cox cjcox at acm.org
Tue Sep 27 21:09:29 CDT 2005


Fred James wrote:
> All
> My brain must be fried, but I just don't see why this
> 
> /*   foo.c   */
> #include <stdio.h>
> int main(int argc, char *argv) {

How about:

int main(int argc, char* argv[]) {

>        printf("%d\n", argc);
>        printf("%s\n", argv[1]);
>        return (0);
> }
> 
> should result in this
> 
> #> ./foo one
> 2
> Memory fault(coredump)
> #>
> 
> Thank you in advance for any help you may be able to offer
> Regards
> Fred James





More information about the Discuss mailing list