simple C question:

From: Sharon (sharonmurphy77_at_hotmail.com)
Date: 12/22/03


Date: Mon, 22 Dec 2003 17:14:08 +0800

I know it is simple but I don't know why the compiler says:
6 d:\ctest~1\1222\untitl~1.cpp implicit declaration of function `int
printf(...)'

so whats wrong with the code?

#include <stdlib.h>

int main()
{
      char* str = "abc";
      printf("%s\n", str);
      system("PAUSE");
      return 0;
}



Relevant Pages

  • Re: Simplicity has a future
    ... c.c:17: error: type defaults to ?int? ... c.c:64: error: implicit declaration of function ?toupper? ... My C compiler gave several screens of errors and warning before giving up. ...
    (comp.lang.c)
  • Re: Newbie question on time()
    ... Just using your compiler to determine the ... int intResult = 0; ... perhaps you should increase the warning level. ... implicit declaration of function 'srand' ...
    (comp.lang.c)
  • Re: struct problem
    ... >So whats the problem? ... mainshould return an int, ... In many cases they are reserved for the compiler, ... HTH, ...
    (comp.lang.cpp)
  • simple C question:
    ... I know it is simple but I don't know why the compiler says: ... so whats wrong with the code? ... int main ...
    (comp.lang.c)
  • Re: syslog-ng 3.5.3 installation on solaris10, i386
    ... configure:3612: checking for gcc ... configure:3908: checking whether the C compiler works ... | #ifdef YY_USE_CONST ... | * int a single C statement. ...
    (comp.unix.solaris)