Need help to solve declaration problems on stl

Dear All
I am trying to create a list of characters already given as below.
When I compile it it gives me following errors.
In function `int main()':
17: error: `islowerCase' undeclared (first use this function)
17: error: (Each undeclared identifier is reported only once for each function it appears in.)
18: error: a function-definition is not allowed here before '{' token
18: error: expected `,' or `;' before '{' token
19: error: `ostream_iterator' undeclared (first use this function)
19: error: expected primary-expression before "char"
19: error: expected `;' before "char"
20: error: `screen' undeclared (first use this function)
listChar.cc:54:2: warning: no newline at end of file
--I would be very happy if someone could help me!
regards
juniper

Okay first things first...
What exactly are you trying to achieve with this code?

Secondly, You can get rid of some of these errors:

1. 17: error: `islowerCase' undeclared (first use this function)
You'll have to write a function definition before attempting to use the function, as it is defined, moving sequentially, below its reference. To make it easier, let it be defined above the main() function. It should also be called as islowerCase(c) // see this: its a function which expects some argument, here, the argument is stored in c2. 18: error: a function-definition is not allowed here before '{' token
18: error: expected `,' or `;' before '{' token

4. Apart from these errors, there are some logical errors, like:
a) You cannot equate vector<string> with a vector<char> , like you did on line 5 of the program you posted, i.e lastElem = remove_if(listChar.begin(), listChar.end(),islowerCase); // Line 1 b) This cannot be done: copy(listChar.begin(), lastElem, screen); // Line 3 If you do this, then the compiler will complain that there's no matching function with such a signature...

c) Add a return 0; to the end of the main() function, although, I believe that some compilers add this automatically(?), but its good practice to write it anyway....

Hope this helped!

EDIT:@jonsca : You can write function definitions without declaring its return-type before-hand, as most compilers treat such functions as integer-returning functions, so here, main() will be taken up to return an integer. So basically, main() will translate to int main() , automatically. This is true for all functions as well.

i am supposing that charList is declared as a vector containing a list ofcharacters. I nedd to Insert the list of characters in the order given: w, W, b, B, C, E, w, F, B, m, into the vector container, charList.
you want use a push_back() function to insert each character or populate the vector with elements from an array.

Further I am supposing that the following two lines of code are added immediately
after the push_back()operations above:
lastElem = remove_if(charList.begin(), charList.end(),
islowerCase); // Line 1
ostream_iterator<char> screen(cout, “ “); // Line 2

where:
· lastElem is declared as an iterator for a vector container of the type char;

I'm still not very sure what you want isLowerCase for, and how it should be used in your program, but, here's how I understand your program:
1. Load the 10 characters into a character vector
2. Copy it into the screen buffer
3. Print it in order, and then in reverse
4. Print its size(1), last index and its last index after swapping the first index with the last.

Here's the code for that. I've removed the string vector, and some other statements that didn't make sense to me....

@jonsca : You can write function definitions without declaring its return-type before-hand, as most compilers treat such functions as integer-returning functions, so here, main() will be taken up to return an integer. So basically, main() will translate to int main() , automatically. This is true for all functions as well.

I understand what you are saying but it is a vestigial feature and at best not a good habit to get into.