Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > C++ Program Execution

Thread Tools

C++ Program Execution
Posts: n/a

I have been getting to know C and C++ alot lately and have come up with
the same problem with each program that I write. When I compile the
program, it comes out with no errors. I can solve those no problem
(usually just a misplaced semicolon) but when it comes to executing the
program to verify my program works correctly, after I input one or
sometimes two variables it closes the window that it is running in. I
have tried using both Visual Studio 2003 and Dev-C++ to compile and run
the programs and it does the same thing in each. Anyone have an ideas
as to why this is happening? I will include code for one that I am just
starting off writing in this post to help you see what is writen.
Thanks in advance for all help recieved.


// Code Start:
#include <iostream>

int main()
char name;
int age = 0;

std::cout << "Enter your name: ";
std::cin >> name;
std::cout << "Enter your age: ";
std::cin >> age;
std::cout << "\nName: ";
std::cout << name;
std::cout << "\nAge: ";
std::cout << age;
// End Code

Reply With Quote

Thread Tools

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
private data stashed in local/global execution context of PyEval_EvalCode disappears down the execution stack Python 9 11-14-2007 10:31 PM
How to make the program delay the execution? wang Java 3 11-14-2005 01:06 PM
doubt in FLI Program and order of execution priya VHDL 0 10-03-2005 12:55 PM
execution of perl program varala_kanth Perl 1 06-26-2004 01:38 PM
perl -d interfering with program execution? Pat Deegan Perl 3 04-22-2004 08:13 AM