int main()
<
using namespace std;
for (int i = 0; i >n;
//Ñ÷èòûâàåì n ÷èñåë â ìàññèâ
for(int i=0; i>a[i];
//Ñëåäóþùèå òðè ñòðîêè îòâå÷àþò çà ñîðòèðîâêó
for(int i=0; i Голосование за лучший ответ
I am getting this error when compiling:
project6.cpp: In function ‘int main()’:
project6.cpp:187: error: expected ‘>’ at end of input
However, there is clearly an end bracket to my int main () function at that line, so I am confused as to why I am getting this error. I also checked all of my other brackets and found none that were not closed. Any help would be much appreciated!
Thread Tools
Search Thread
Display
- Linear Mode
- Switch to Hybrid Mode
- Switch to Threaded Mode
linked list and read strings-problem
GO TO POST 6 (is my new problem)
<
this solved
I am getting this message when i am trying to compile the code
series1.c:44: σφάλμα: expected declaration or statement at end of input
series1.c:44: σφάλμα: expected declaration or statement at end of input
where is the mistake?(maybe any missing < or >)
Last edited by alzar; 09-20-2007 at 12:23 PM .

If you indent your code correctly, you’ll notice that you are missing two curly braces.

Count the number of closing braces which your main() seems to have.
Read the FAQ on why you shouldn’t use gets()

I am getting this message when i am trying to compile the code
series1.c:44: σφάλμα: expected declaration or statement at end of input
series1.c:44: σφάλμα: expected declaration or statement at end of input
where is the mistake?(maybe any missing < or >)
This code was a part of an exercise that i have, so i forget to close switch and main.Sorry

This is an infinite loop if k is anything other than 0. There is no modification of k beyond the initial scanf call.
= is for assignment, == is to test for equality. Second, head is not in scope here. Third, currenta hasn’t yet been initialized the first time the function is called, head is equal to NULL and in fact does not change it’s value so it will always be NULL and the rest of the code (the else part) will never get executed.
newa never gets initialized to anything valid (in the above if test it is effectively set to the same random address as currenta). Same thing with firsta and since currenta points to this random memory address I certainly wouldn’t want to try and access its next pointer member. I think newa is really supposed to be newnode here in this function and firsta is maybe supposed to be set to head which gets passed in as a parameter?
The whole function should either be returning a pointer to a new node, or setting an argument passed into the function to the newly allocated memory, or something like that. Bottom line is there’s a lot wrong with this code that needs fixing.