Discuss Help please in the Programming forum on Dev Hardware. Help please Programming forum discussing administration and coding scripts in languages including PHP, C++, C, Perl, Java, Visual Basic, XML, HTML, CGI, ActionScript, CSS, JavaScript, Fortran, BASH, and issues related to databases and even batch files.
ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month!
Open source technologies have proven to be extremely advantageous to businesses.
This adaptive and highly efficient kind of software is central to the infrastructure of most companies. Since the world of open source technology is constantly changing,
IT professionals need a resource to give them up-to-the-minute information about these enterprise level and open source technologies. Dev Shed is that resource .
The ASP Free website provides in-depth information on the latest developer tools available from Microsoft. Our cadre of writers, highly experienced industry experts, reveals the best ways to use established technologies as well as new and emerging technologies. Our coverage of Microsoft's development and administration technologies is among the most respected in the IT industry today. .
Posts: 1
Time spent in forums: 8 m 57 sec
Reputation Power: 0
C - Help please
I'm just starting to learn some programming and i'm using Dev-C++ to compile my programs. I can't work out why the following won't work, especially seeing as system("pause"); has worked in other programs:
/* Demonstrates using multiple return statements in a function. */
#include <stdio.h>
int x, y, z;
int larger_of(int a, int b);
int main()
{
puts("Enter two different integer values: ");
scanf("%d%d", &x, &y);
z = larger_of(x, y);
printf("\nThe larger value is %d.", z);
system("pause");
return 0;
}
int larger_of(int a, int b)
{
if(a>b)
return a;
else
return b;
}
I get an error message:
17 `system' undeclared (first use this function)
Can someone please tell me whats wrong - i'm probably being really stupid! I've tried using get(), getch(), getchar(), cin.get() all out of desperation but can't get anything to work!
Posts: 4,112
Time spent in forums: 1 Month 1 Week 6 Days 17 h 51 m 19 sec
Reputation Power: 7080
There's a library you have to include to be able to use the 'system()' call. I can't remember what it is offhand, I've used it in C++ but it's been ages ago.
If you've used it in other programs, check your headers on those source files.
LOADING INFUSIONSOFTLOADING INFUSIONSOFT 1debug:overlay status: OFF overlay not displayed
overlay cookie defined: TI_CAMPAIGN_1012_D
OVERLAY COOKIE set:
status off