Program failed, syntax error.

Hi guys, can you please help me to find the error? I´m working with the latest version of Geany and I actually don´t know how to find my mistake.

Thank you all for your supporting. The code is:

Last edited on
Hello HJ3475,


PLEASE ALWAYS USE CODE TAGS (the <> formatting button), to the right of this box, when posting code.

Along with the proper indenting it makes it easier to read your code and also easier to respond to your post.

http://www.cplusplus.com/articles/jEywvCM9/
http://www.cplusplus.com/articles/z13hAqkS/

Hint: You can edit your post, highlight your code and press the <> formatting button.
You can use the preview button at the bottom to see how it looks.

I found the second link to be the most help.



Your program expects something from the command line, but you have neglected to give an example of a proper command line. Do not expect those reading your post to guess at what to use. It will more often be wrong and more difficult to give you an answer.

Next give some idea of what the program is doing or not doing. If there are any errors from a compile post them in their entirety, not what you think they mean. Error messages can mean more to others than they do to you.

In the mean time I will see what I can figure out.

Hope that helps,

Andy
Hello HJ3475,

A quick look at your code shows spelling mistakes, missing ()s, a closing ) in the function. And many syntax errors.

You write: if (argc > = 4). This should be written as ">=", "<=" and "!=". With the space the compiler treats each operator separately.

C++ is case sensitive, so int TamFinal and tamFinal are considered two different variables.


In the line: vData.push_back(read data); I have not found where "read" and "data" are defined and the error says they are not defined. Also it looks like you are trying to put two separate variables into a vector that can only hold one variable per element. You need to explain what you are trying to do here.

At the end of "main" you "return 4". Is there a reason for this? Returning (0) zero means that the program ended with no problem and any number greater than (0) zero means that there was something wrong with the program. You may have a different reason for returning something other than (0) zero and that is fine.

In the function you wrote:
1
2
3
std::vector<buul> bitMsimo(const std::vector <int> & data, int n, int m)
{
	std::vector<buul> bitM;

Did you mean "bool"?

I will try to clean up your code, but may have more questions later.

Hope that helps,

Andy

Edit:
Last edited on
Hello HJ3475,

While working on the program I realized the program uses a file.

You need to include the file, or a good sample, so that everyone will be working with the same information.

For now I have no idea what to put in the file I have created for testing.

Andy

Edit:

Also what are the variables "m" and "n" used for and what values should the have?
Last edited on
> I actually don´t know how to find my mistake.
start by reading the error message
if you don't understand it, then post it and we'll explain it.
Topic archived. No new replies allowed.