View Single Post
Old Oct 26th, 2005, 5:43 PM   #1
D-Ferg27
Programmer
 
D-Ferg27's Avatar
 
Join Date: Oct 2005
Posts: 49
Rep Power: 0 D-Ferg27 is on a distinguished road
Tutorial Problem

ok im using an online tutorial that some one on this site(i forget who) posted a link for. its just a variable example it doesn't work.When i compile and run it all it does is just flash somthing then highlight the cout part. The tutorial i think is based towards Ansi-C++ but im using Dev-C++. Would that be that reason its not working?

here is the code:

// operating with variables

#include <iostream.h>
using namespace std;

int main ()
{
  // declaring variables:
  int a, b;
  int result;

  // process:
  a = 5;
  b = 2;
  a = a + 1;
  result = a - b;

  // print out the result:
  cout << result;

  // terminate the program:
  return 0;
}


first i tryed it on my own and it didn't work so then i just copied and pasted and it still did the same thing. What is the problem. I think its a compiler difference.
D-Ferg27 is offline   Reply With Quote