Vc++

Status
Not open for further replies.

Mohan Giri

In Runtime
Messages
144
Hello I am running first time my C programs in VC++. I am getting error like

fatal error C1010: unexpected end of file while looking for precompiled header directive
Error executing cl.exe.

My code is :

#include<stdio.h>
void main()
{

int i;
void sort(int *);
int a[5]={5,5.2,4,6.3};
sort(a);
for(i=0;i<5;i++)
printf("%d ",a);
}
void sort(int *p)
{
int i,j,t;
for(i=0;i<4;i++)
for(j=0;j<5;j++)
if(p>p[j])
{
t=p;
p=p[j];
p[j]=t;
}
}


Help me to fix the error.
 
It's probably yelling at you because it looks like you're declaring a function within main()

get rid of the line that states void sort(int *);
Code:
void main()
{

int i;
void sort(int *);  <- get rid of this line!
int a[5]={5,5.2,4,6.3};
sort(a);
for(i=0;i<5;i++)
printf("%d ",a[i]);
}
 
Status
Not open for further replies.
Back
Top Bottom