|
From: Randy H. <ran...@rc...> - 2001-03-27 12:26:59
|
Hi..I'm just getting started and I understand that when you want to halt
the screen in order to read the result in DOS you must enter
system("PAUSE");
Why does this work sometimes and other times I get a compilation error
" 18: implicit declaration of function `int system(...)' "
Here is a sample no-brainer program I coded that produces just that
error...
Thanks!
#include <stdio.h>
main()
{
float perCent,result,num;
printf("Enter the number you want a percentage of :\n");
scanf("%f",&num);
printf("Enter the percentage of that number you want calculated :\n");
scanf("%f", &perCent);
result = (num * perCent)/100;
printf("%f percent of %f = %f", perCent,num,result);
system("PAUSE");
return 0;
}
|
|
From: Kris N. <kna...@gm...> - 2003-04-03 07:46:15
|
Dear, I downloaded and installed dev-C++ version 4.9.8.0 but cannot compile anything. I get the following message: cannot find entry symbol_mainCRTstartup; defaulting to 00401000 linker error: undefined reference to 'strcpy' etc. I can compile files with g++ version 2.95.3-5 in Cygwin which I used uptill now. The progra contains nothing special, reading ascii data, some basic calculations, export again+. Any help would be greatly appreciated. Kris |
|
From: Andre` N. C. <ca...@op...> - 2001-03-27 12:57:57
|
well, for one you need to have int main() or the incorect void main() but
never just main()
at the end of your program you returned 0 so your main function has to be an
int.
Your other problem is you need the correct header file. I'm not sure what
it is..
I cant remember been a while since DOS land!:)
Randy Hust wrote:
> Hi..I'm just getting started and I understand that when you want to halt
> the screen in order to read the result in DOS you must enter
> system("PAUSE");
> Why does this work sometimes and other times I get a compilation error
> " 18: implicit declaration of function `int system(...)' "
>
> Here is a sample no-brainer program I coded that produces just that
> error...
> Thanks!
>
> #include <stdio.h>
>
> main()
> {
> float perCent,result,num;
>
> printf("Enter the number you want a percentage of :\n");
> scanf("%f",&num);
>
> printf("Enter the percentage of that number you want calculated :\n");
> scanf("%f", &perCent);
>
> result = (num * perCent)/100;
>
> printf("%f percent of %f = %f", perCent,num,result);
>
> system("PAUSE");
>
> return 0;
>
> }
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Simon R H. <sim...@kc...> - 2001-03-27 13:21:50
|
try
#include <iostream.h>
On Tue, 27 Mar 2001 07:25:22 -0800 Randy Hust <ran...@rc...>
wrote:
>
> Hi..I'm just getting started and I understand that when you want to halt
> the screen in order to read the result in DOS you must enter
> system("PAUSE");
> Why does this work sometimes and other times I get a compilation error
> " 18: implicit declaration of function `int system(...)' "
>
> Here is a sample no-brainer program I coded that produces just that
> error...
> Thanks!
>
> #include <stdio.h>
>
> main()
> {
> float perCent,result,num;
>
> printf("Enter the number you want a percentage of :\n");
> scanf("%f",&num);
>
> printf("Enter the percentage of that number you want calculated :\n");
> scanf("%f", &perCent);
>
> result = (num * perCent)/100;
>
> printf("%f percent of %f = %f", perCent,num,result);
>
> system("PAUSE");
>
> return 0;
>
> }
>
>
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
----------------------
Simon R Hillman
sim...@kc...
|
|
From: Francesco T. <tor...@un...> - 2001-03-27 14:17:31
|
> Why does this work sometimes and other times I get a compilation error > " 18: implicit declaration of function `int system(...)' " > The prototype of the function system is contained in the header stdlib.h, thus you should add #include <stdlib.h> to your program. Hope this helps Francesco |
|
From: Ray W. <ra...@in...> - 2001-03-27 17:20:46
|
You need to include "#include <stdlib.h>" , no quotes, to get it to work.
ray.
At 07:25 AM 3/27/01 -0800, you wrote:
>
>Hi..I'm just getting started and I understand that when you want to halt
>the screen in order to read the result in DOS you must enter
>system("PAUSE");
>Why does this work sometimes and other times I get a compilation error
> " 18: implicit declaration of function `int system(...)' "
>
>Here is a sample no-brainer program I coded that produces just that
>error...
>Thanks!
>
>#include <stdio.h>
>
> main()
>{
>float perCent,result,num;
>
>printf("Enter the number you want a percentage of :\n");
>scanf("%f",&num);
>
>printf("Enter the percentage of that number you want calculated :\n");
>scanf("%f", &perCent);
>
> result = (num * perCent)/100;
>
> printf("%f percent of %f = %f", perCent,num,result);
>
> system("PAUSE");
>
> return 0;
>
> }
>
>
>
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
>
Ray Witter
|
|
From: Ioannis V. <no...@ya...> - 2001-03-27 23:40:43
|
#include <stdlib.h> Ioannis * Ioannis Vranos * Programming pages: http://members.nbci.com/noicys * Alternative URL: http://run.to/noicys > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...]On Behalf Of Randy Hust > Sent: Tuesday, March 27, 2001 5:25 PM > To: dev...@li... > Subject: [Dev-C++] Newbie > > > > Hi..I'm just getting started and I understand that when you want to halt > the screen in order to read the result in DOS you must enter > system("PAUSE"); > Why does this work sometimes and other times I get a compilation error > " 18: implicit declaration of function `int system(...)' " > > Here is a sample no-brainer program I coded that produces just that > error... > Thanks! > > #include <stdio.h> > > main() > { > float perCent,result,num; > > printf("Enter the number you want a percentage of :\n"); > scanf("%f",&num); > > printf("Enter the percentage of that number you want calculated :\n"); > scanf("%f", &perCent); > > result = (num * perCent)/100; > > printf("%f percent of %f = %f", perCent,num,result); > > system("PAUSE"); > > return 0; > > } > > > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Linda H. <lz...@sp...> - 2001-03-28 04:26:06
|
Try int main () and a couple of cin.get(); before the return 0.
Linda
---------------------------------
----- Original Message -----
From: "Randy Hust" <ran...@rc...>
To: <dev...@li...>
Sent: Tuesday, March 27, 2001 10:25 AM
Subject: [Dev-C++] Newbie
>
> Hi..I'm just getting started and I understand that when you want to halt
> the screen in order to read the result in DOS you must enter
> system("PAUSE");
> Why does this work sometimes and other times I get a compilation error
> " 18: implicit declaration of function `int system(...)' "
>
> Here is a sample no-brainer program I coded that produces just that
> error...
> Thanks!
>
> #include <stdio.h>
>
> main()
> {
> float perCent,result,num;
>
> printf("Enter the number you want a percentage of :\n");
> scanf("%f",&num);
>
> printf("Enter the percentage of that number you want calculated :\n");
> scanf("%f", &perCent);
>
> result = (num * perCent)/100;
>
> printf("%f percent of %f = %f", perCent,num,result);
>
> system("PAUSE");
>
> return 0;
>
> }
>
>
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|