0

hi ppl,
i just starte a new program, but now im having a lot of error wich "i think i wrote the code well", but cant understand what they mean...

here i pass the code...

#include "stdafx.h"
#include <iostream>

#define ingresos_totales 5;

using namespace std;



int main(int argc, char* argv[])
{
	int i, number;

	for (i=0; i<ingresos_totales; i++)
	{
		cout << " Type a number: ";
		cin >> number;
	}

	return 0;
}

and the errors its givin me are:

C:\Documents and Settings\pm11218\vectores_entrega\vectores_entrega.cpp(17) : error C2146: syntax error : missing ')' before identifier 'i'
C:\Documents and Settings\pm11218\vectores_entrega\vectores_entrega.cpp(17) : error C2059: syntax error : ';'
C:\Documents and Settings\pm11218\vectores_entrega\vectores_entrega.cpp(17) : error C2059: syntax error : ')'
C:\Documents and Settings\pm11218\vectores_entrega\vectores_entrega.cpp(18) : error C2143: syntax error : missing ';' before '{'
Error executing cl.exe.

i thinks that i wrote the code well, but errors are errors... n just cant figure out how can i fix them...

gispe!!


ps: maybe its the dumest thing in the world, but i just cant see it :s

2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by gispe
0

delete the semicolon on line 4. defines don't end with a semicolon. It would be better to use a const int instead of that #define const int ingresos_totales = 5;

0

thanks!

forgot bout that!
put 5 for testin, it goin to have a bigger numer :P

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.