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

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;

thanks!

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.