| |
| |
| Join The Cult | Tweakers | Image Gallery | Donate | Search | Today's Posts | Mark Forums Read | |
Welcome to Tweak3DThis is an open forum about tech stuff, games, and cars. Register to access all forums, and to hide this ad and others. |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
| | permanent link to #1 |
| Senior Member | I currently purchased Microsoft Visual C++.net Standard version 2003 for my Computer Science class. I can make a simple program, but the assignment that my teacher gave us, I cannot figure out. He wants use to create a program that we can print. Here is the code he gave us. //File: welcome.cpp - Program to print a welcoming message #include <iostream.h> #include <conio.h> int main (void) { cout << "Welcome to CSE 123! \n"; getch(); return 0; } How do I go about starting up a program to make this code work out the way I want it to. I am totally lost. I need step by step intructions if someone could help. I really appreciate it. |
| | |
| | #2 |
| | |
| | |
| | permanent link to #2 |
| El Chupacabra | You are going to create a new console application, or just create a .cpp file, put that code in there, compile it and you are done. |
| |
| | |
| | permanent link to #3 |
| Senior Member | I've done that, but its telling me there is an error. My output says, "------ Build started: Project: CSE123, Configuration: Debug Win32 ------ Compiling... stdafx.cpp Compiling... CSE123 5.cpp CSE123 5.cpp(12) : fatal error C1010: unexpected end of file while looking for precompiled header directive AssemblyInfo.cpp CSE123.cpp Generating Code... Build log was saved at... CSE123 - 1 error(s), 0 warning(s) ---------------------- Done ---------------------- Build: 0 succeeded, 1 failed, 0 skipped" Hmm... what should I do? |
| |
| | |
| | permanent link to #4 | |
| 3D+Linux Master | Quote:
put this line below your #includes namespace std; //i think thats the syntax its been a while or put the std namesace indacator before each cin/cout/ or anything else your using in that namespace std::cout Your 2nd problem is that you not using the getch(); function correct this means you dont understand it so do everyone a favor and use google.com Oh i think your using the wrong header for getch(); too i believe its curses.h | |
| | ||
| | |
| | permanent link to #5 |
| I Am The Black Wizards | #include <iostream> using namespace std; int main() { cout << "Stuff here" << endl; return 0; } I don't even know what getch() is, but that's the same exact thing that you have written, just in a bit more simplified terms. I suggest trying DevCPP; no need to create a new project for a simple 7 line program. |
| | |
| | |
| | permanent link to #6 | |
| Rogue One | Quote:
NoPunIntended: your problem is probably just that you've removed the Code: #include "stdafx.h" | |
| Per Ardua Ad Astra | ||
| | |
| | permanent link to #7 | |
| I Am The Black Wizards | Quote:
Works just like this getch you describe =) | |
| | ||
| | |
| | permanent link to #8 |
| Rogue One | Yep, but getch() is a better way to do it, because you're just calling a function, not some external command. You also have more control over things - with "pause", you'll always get the "Press any key to continue" message displayed, which you might not want depending on your app. |
| Per Ardua Ad Astra | |
| | |
| | permanent link to #9 |
| Tweak Minion | #include <iostream> #include <stdlib.h> using namespace std; int main( int argc, char** argv ) { cout << "Welcome to CSE 123!" << endl; system( "pause" ); return 0; } try that |
| | |
![]() |
| 1 people are viewing this thread! (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PC crash, video card suggestions needed! | MSP | Tech | 20 | 07-21-2006 07:57 PM |
| New keyboard and mouse needed -UPDATED with initial thoughts | Lazaredz | Tech | 11 | 07-21-2006 07:24 PM |
| Resume Help needed Please!!!!! | Alpha | OT Graveyard | 8 | 06-06-2006 06:16 PM |
| little assistance needed | Jamsan | OT Graveyard | 0 | 06-04-2006 11:59 PM |
| Upgrading my PC soon! Advice needed. | Chris | Tech | 5 | 05-15-2006 10:17 PM |