void function not reconized

Hi everybody! I'm a student and I just started studying vectors in c++ programming. My problem is that when my computer compile and run the program it seems like it does not reconize the function "void" telling me "process exit after 0.345 seconds with retune value 0". This is the program:

<#include <iostream>
#include <stdlib.h>
#include <stdio.h>
using namespace std;

int V[100], S[100], I, N, i;

void chiedilunghezza ()
{do
{cout<<"Inserisci lunghezza vettore";
cin>>N;}
while (1<N || N>100);
}

void caricamento1 ()
{for (I=1; I=I+1; I<=N)
{cout<<"Inserisci numero";
cin>>V[I];}
}

void caricamento2 ()
{for (I=1; I<=N; I=I+1)
{cout<<"Inserisci numero";
cin>>S[I];
}
}

void confronto ()
{for (I=1; I<=N; I=I+1)
{for (i=1; i<=N; i=i+1)
if (V[I]==S[i])
{cout<<"Il numero in comune e'"<<V[I]<< ("\n");
}}}


int main(void) {

void chiedilunghezza ();
void caricamento1 ();
void caricamento2 ();
void confronto ();

return 0;
}>
Can anybody help me? Thank you lots!
Last edited on
it seems like it does not reconize the function "void"


That's because your four functions calls in main are treated as function prototypes.
Remove the void keyword:

1
2
3
4
5
6
7
int main(void) 
{  chiedilunghezza ();
    caricamento1 ();
    caricamento2 ();
    confronto ();
    return 0;
}


PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post.
http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.
Thank you so much! Now it works perfectly! And yes, I'll do it :D
Topic archived. No new replies allowed.