Note that there are some explanatory texts on larger screens.

plurals
  1. POIdentifier both declared and undeclared in same section of code - C2065 VS2010 C++
    primarykey
    data
    text
    <p>In my int main() segment of code I declared an identifier (tile). On some lines the identifier thinks it's undeclared, while on other lines it recognizes it's declaration. The initial declaration is outside of all brackets (other than the main). Why is this occurring?</p> <pre><code>int main( int argc, char* args[] ) { //Quit flag bool quit = false; //The dot Dot myDot; //The tiles that will be used Tile *tiles[ TOTAL_TILES ]; //The frame rate regulator Timer fps; //Initialize if( init() == false ) { return 1; } //Load the files if( load_files() == false ) { return 1; } //Clip the tile sheet clip_tiles(); //Set the tiles if( set_tiles( tile ) == false ) { return 1; } //While the user hasn't quit while( quit == false ) { //Start the frame timer fps.start(); //While there's events to handle while( SDL_PollEvent( &amp;event ) ) { //Handle events for the dot myDot.handle_input(); //If the user has Xed out the window if( event.type == SDL_QUIT ) { //Quit the program quit = true; } } //Move the dot myDot.move( tiles ); //Set the camera myDot.set_camera(); //Show the tiles for( int t = 0; t &lt; TOTAL_TILES; t++ ) { tiles[ t ]-&gt;show(); } //Show the dot on the screen myDot.show(); //Update the screen if( SDL_Flip( screen ) == -1 ) { return 1; } //Cap the frame rate if( fps.get_ticks() &lt; 1000 / FRAMES_PER_SECOND ) { SDL_Delay( ( 1000 / FRAMES_PER_SECOND ) - fps.get_ticks() ); } } //Clean up clean_up( tile ); return 0; } </code></pre> <p>My problem is with <code>clean_up ( tile);</code> and <code>set_up ( tile );</code> -- or at least that's where my error codes line up.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload