code not compiling

0 girish gogia · June 26, 2015
#include 
#include
#include
#include
#include

void printx(char message[],int amount)
{
    for(int i = 0;i < amount; i++){
   printf("Error: %s",message);
    }

}

int main()
{

   printx("Try again",1);



    return 0;
}


Post a Reply

Replies

Oldest  Newest  Rating
0 c student · June 26, 2015
void printx (char *message,int amount)
0 girish gogia · June 28, 2015
still does not works
0 Homer Simpson · June 28, 2015
What errors are you getting?

Try : 

int I;

for( i =0; i < amount; i++)

.... 
}
0 girish gogia · June 28, 2015
it says compile in c99 mode
0 Homer Simpson · June 28, 2015
Did you try it the way I suggested, the c89 required all variables be declared at the start of their scope. Or you can change your compiler settings to compile according to the newer standards.
  • 1

C

107,176 followers
About

One of the most popular languages of all time.

Links
Moderators
Bucky Roberts Administrator