expected unqualified-id error

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
int main ()

{
    int first[SIZE];
    read_array (first,SIZE);
}
void array (int read[] , int size1)
{
    srand( (unsigned int) time(NULL));

    for (int i=0 ; i <= 50; i++)
    {
        read[i] = rand() % 50; // The will create up to 50.
        cout <<"This the is your number " << i <<"Position is " << read[i] <<endl;
    }
Last edited on
http://en.wikipedia.org/wiki/Forward_declaration

Compilers process code more or less top to bottom so you need to let it know that you plan on defining a function if you call it before doing so. You're also missing a close curly brace but that might have been a copy paste error.
You also have an extra semicolon after void read_array (int read[] , int size1).

Also, shouldn't it be for (int i = 0; i < size1; i++)?
I feel so dumb right now! semicolon is problem... it function not prototype.
FYI: removing your original question is a jerk move. Don't do it.

I can't tell you how many times I was able to find a solution for a problem I was having by googling and finding an old forum post. If everyone removed their post after they got an answer, I wouldn't have had that luxury.

So yeah. Don't be a jerk. Leave your post so others can benefit from it.
I thought it gonna be again the rule!
byway do you know if there any compiler out for mac beside xcode? xcode is cool at some point but sometime is a S**T or F**K
This isn't really the type of place to be asking these types of questions OP but if the rash has lasted as long as you say it has then you really should go see a doctor or maybe go to the ER if the burning doesn't stop even after using that much ointment.

I feel so dumb right now! semicolon is problem... it function not prototype.


Designing something to get around the problem that it is causing, whether it is functional or just a prototype, is clever but it doesn't really solve your problem. I appreciate you using the word 'semicolon' in place of the actual name for that component by the way, it is good that you remember that there are children on this site.

What's this OP? You've gone and deleted the original post?! Hopefully no sick individual starts responding with things that are completely out of context so as to skew an outsiders opinion of what might have been written here. This could become a very awkward thread for you if that were to happen.
Topic archived. No new replies allowed.