home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Join TechIMO for Free!
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Reply Get bargains at  »  Dealighted.com
 
Thread Tools
Currently Active Users: 1913
Discussions: 188,398, Posts: 2,243,591, Members: 232,627
Old November 24th, 2004, 06:08 PM   Digg it!   #1 (permalink)
Member
 
NodX5's Avatar
 
Join Date: Nov 2004
Posts: 118
Programming(c++) error

#include <iostream>
using namespace std;
int main()
{

cout << "-----text here------.\n";
system("pause");
cout << "----text is in here---.";
cout << "------text here----------------------.";
cout << "---------same here again obviously------ "
system("pause"); // <-------- error here
return 0;
}

hey look at that code and tell me whats wrong with it please? thanks for all who help and my compiler proggy thingy is Dev-Cpp 4.9.9.0

(i wrote a similar program to this b4 but i didnt get an issue on that line where i put a comment)


Last edited by NodX5 : November 24th, 2004 at 06:14 PM.
NodX5 is offline   Reply With Quote
Old November 24th, 2004, 06:22 PM     #2 (permalink)
Ultimate Member
 
Ryanoffski's Avatar
 
Join Date: Jul 2003
Location: West Valley City, Ut
Posts: 1,202
Send a message via MSN to Ryanoffski
you forgot a ; after the last cout. It just gives you the error on the next line after where the ; should be.
__________________
Educate Yourself


Last edited by Ryanoffski : November 24th, 2004 at 06:34 PM.
Ryanoffski is offline   Reply With Quote
Old November 24th, 2004, 06:23 PM     #3 (permalink)
Ultimate Member
 
Ryanoffski's Avatar
 
Join Date: Jul 2003
Location: West Valley City, Ut
Posts: 1,202
Send a message via MSN to Ryanoffski
Code:
#include <iostream>
using namespace std;
int main()
{

cout << "-----text here------.\n";
system("pause");
cout << "----text is in here---.";
cout << "------text here----------------------.";
cout << "---------same here again obviously------ ";
system("pause"); // <-------- error here
return 0;
}
Here it is fixed.

Ryanoffski is offline   Reply With Quote
Old November 24th, 2004, 11:18 PM     #4 (permalink)
Member
 
NodX5's Avatar
 
Join Date: Nov 2004
Posts: 118
omg.... i feel like a retard now....
NodX5 is offline   Reply With Quote
Old November 24th, 2004, 11:47 PM     #5 (permalink)
Ultimate Member
 
Ryanoffski's Avatar
 
Join Date: Jul 2003
Location: West Valley City, Ut
Posts: 1,202
Send a message via MSN to Ryanoffski
No, it's always a good idea to have someone with fresh eyes look at the code. I swear, if I were writing that, I would probably have done the exact same thing.
Ryanoffski is offline   Reply With Quote
Old November 25th, 2004, 12:33 AM     #6 (permalink)
Space for Sale! :p
 
eagle1's Avatar
 
Join Date: Oct 2001
Location: La Isla del Encanto
Posts: 5,832
That happens a lot!
And when the codes start getting complicated and you start to use a lot of if and fors and switch cases, etc you will have to look out not only cor colons but for these little guys! { }

__________________
boo!
eagle1 is offline   Reply With Quote
Old November 25th, 2004, 12:48 AM     #7 (permalink)
Member
 
NodX5's Avatar
 
Join Date: Nov 2004
Posts: 118
ha thanks for the encouragement :P ill remember to look out for stuff like the semi colons... hope that doesnt happen again... sorry if i wasted ur time... but im moving onto the arithmetic stuff im on my way there!

again thnx for the help if i didnt mention it
NodX5 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
RAID-1 neila Storage Related 21 July 31st, 2004 06:40 PM
dll.error miriam Technical Support 5 June 26th, 2004 11:45 PM
iMac not booting Jonty Technical Support 2 June 9th, 2003 05:51 PM
VBox Error! (what the heck) ComputerNerd8888 Technical Support 3 May 23rd, 2003 04:26 PM
Site not working EagleID General Discussion and Buyer Guidance 2 March 13th, 2002 05:56 PM

Most Active Discussions
Is It Just Me? (2904)
Unarmed man on his stomach shot by .. (6)
3-days in and no threads about Gaza (161)
New Build ( Finally ) (6)
CPU wont boot (7)
Building a gaming computer advice (5)
I think I just killed my computer w.. (24)
Folderchat Weekday thread (444)
Upgrading RAM (6)
Recent Discussions
Left 4 Dead Small Freezes (3)
RCA 52Inch HDTV wont turn on (4)
wishin i could edit my aol prof.. (0)
For cheap price and good qualit.. (0)
Sporadic internet connectivity (2)
Assassins Creed PC Problems (40)
I think my PSU is dieing (1)
building a gaming computer, inp.. (0)
Iming and surfing slowed down (3)
Blackberry Storm, Gears of War .. (1)
Core 2 Quad Q9550 system (3)
COWBOOM Ripoff! Used Laptop w/$.. (4)


All times are GMT -4. The time now is 03:15 AM.
TechIMO Copyright 2008 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28