Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

error "length" is not a type!

$
0
0
i got an error in project "snake" its near 700 lines so i cant copy all of it. but the problem is the compiler gives me "length" is not a type.and its kinda weird.the language is "c"


"""""
struct snake_place
{
    int x ;
    int y ;
};

struct snake_data
{
    int length ;
    struct snake_place snake_array [50] ;
    struct snake_place head ;
    struct snake_place tail ;
    int direction ;
};
struct snake_data snake;



.........
........
void shift1(){
    int i;
    int snake,length,snake_array;
    int snake1;
        for (i = 0 ; i < snake1.length - 1 ; i++ ){
        snake1.snake_array[i] = snake1.snake_array[i+1] ;
        }
    }
 """""



in void shift1() there is an error i cant solve.and im in a hurry...

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>