views:

148

answers:

2

hi every one this is my first time on Visual studio & this message "Note: C++ does not support default-int" keep showing pleas someone tell me what wrong with my C code

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

void remplire (int t[] , int n ) ;
void afficher (int t[] , int n ) ;

void main ()
{
    const long_tab = 2000 ;
    int t[long_tab] ;
    srand (time(NULL));
    remplire ( t , long_tab );
    afficher ( t , long_tab );
}
void remplire (int t[] , int n )
{
    int i ;
    for (i=0 ; i<= n ; i++)
     {
      t[i] = rand () ; 
     }
}

void afficher (int t[] , int n )
{
    int i ;
    for (i=0 ; i<= n ; i++)
     {
      printf ("%d \t" , t[i]);
      if( i%10 == 0 )
       printf ("\n");
     }
}
+1  A: 

const long_tab = 2000 should be const int long_tab = 2000. You may have other problems too, but I can't easily read your code because it got badly reformatted by SO.

Nicolás
could you pleas tell me where are the other mistakes
hamza
Now that Juliet reformatted your code, I don't see anything else wrong *related to that compiler error*.
Nicolás
+10  A: 

C++ shows this error when you omit the identifier type.

const int variable1; //OK
const variable2; //Not OK

This is MSDN description of the error:

http://msdn.microsoft.com/en-us/library/ms173696%28VS.80%29.aspx

Also, if you highlight the error in the output tab and press F1 - Visual Studio Help will show you a page explaining the error in more detail, similar to the link above.

Igor Zevaka
thanks a lot , really
hamza
Implicit int has been removed in C99 and it isn't part of C++98 too.
Prasoon Saurav