473,503 Members | 1,705 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error with System("pause"); - Please Help

5 New Member
Hi,

I can not get the system pause to work in a simple program. Here is my program below:

// i/o example

#include <iostream>
using namespace std;

int main ()
{
int i;
cout << "Please enter an integer value: ";
cin >> i;
cout << "The value you entered is " << i;
cout << " and its double is " << i*2 << ".\n";
system("pause");
return 0;
}

I get an implicit declaration of function 'int system(...)' error when I try to enter the pause code. I can not seem to get it to pause to program to see the results!! Please help
Jul 25 '07 #1
5 6466
Darryl
86 New Member
Are you on a windows machine? "pause" is a windows console command
Jul 25 '07 #2
CoderMarc
5 New Member
I just got some help from a friend. I needed #include <string> to be able to use the code
system("pause");

Problem Solved!!!
Jul 25 '07 #3
JonLT
41 New Member
you could just run your program from the console, then you would not need to pause it
Jul 25 '07 #4
CoderMarc
5 New Member
I was using Bloodshed C++ program on my Windows XP System. I am just learning to program in C++
Jul 25 '07 #5
CoderMarc
5 New Member
Solution Found! Thanks For Help Again!!! I needed the header #include <string>
Jul 25 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

5
4110
by: Brian.Steele | last post by:
Greetings everyone. See http://www.spiceisle.com/cgi-bin/slideshow/slideshow.cgi?dir=brian/personal/2005/uk_trip/images&type=jpg The "Pause" button works in IE, but not in Firefox. Any ideas...
11
39854
by: Paminu | last post by:
Is there something like system("PAUSE") for linux?
4
30336
by: Kerwin Cabrera | last post by:
I am writing a console application and I would like to put a "Press any key..." message once the program is done executing. Currently, when it executes it returns to the prompt. I have tried...
3
2747
by: RR | last post by:
I have a button on a form (form A) that opens another form. The form that opens (form B) has a listbox that is populated with a call to a function in the "on current" event. When form B with the...
14
2334
by: Chen Shusheng | last post by:
CSS white here: Simply strange, I found "define" can not work with "malloc". Together my complier will say "parse error". Could anyone tell me why? ------------------------- #define MAX 10000...
5
2388
by: Madmartigan | last post by:
Gidday Question : Write a program that will report the longest and shortest string in its input. I am attempting EX 3.4(page 49) from Accelerated C++ by Koenig and Moo. I keep getting the...
8
6681
by: MLZ242 | last post by:
I'm supposed to write a program that is going to calculate absolute value of given number(and print appropriate message) but I'm having tough time with the statements(expected primary-expression...
1
1694
by: Wazza | last post by:
G'Day, I have a re-occurring problem and wish to design a framework or pattern to address it. I have some Ideas but I would like to do some brainstorming with my peers before commencing. The...
12
1899
by: kevineller794 | last post by:
I want to make a split string function, but it's getting complicated. What I want to do is make a function with a String, BeginStr and an EndStr variable, and I want it to return it in a char...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7280
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7460
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.