<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Brauche Hilfe bei einem Programm]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich versuche grade auf <a href="http://lazyfoo.net" rel="nofollow">lazyfoo.net</a> SDL zu lernen!</p>
<p>Bis jetzt ging alles gut ...</p>
<p>Ich hänge an folgendem Code:</p>
<pre><code>#include &lt;string&gt;
#include &lt;iostream&gt;
#include &quot;SDL.h&quot; 

using namespace std;

int main( int argc, char* args[]) 
{ 
	const int SCREEN_WIDTH = 640;
	const int SCREEN_HEIGHT = 320;
	const int SCREEN_BPP = 32;

	SDL_Surface *background=NULL;
	SDL_Surface *message=NULL;
	SDL_Surface *screen=NULL;

	[b]SDL_Surface *load_image( std::string filename ) {[/b] 

	SDL_Surface* loadedImage = NULL; 

	SDL_Surface* optimizedImage = NULL; 

	loadedImage = SDL_LoadBMP( filename.c_str() ); 

	if( loadedImage != NULL ) 
	{ 
	     optimizedImage = SDL_DisplayFormat( loadedImage ); 		
             SDL_FreeSurface( loadedImage );
	} 

	return optimizedImage; 
}
</code></pre>
<p>In Zeile 17 wird statt dem letzten Zeichen (geschwungene Klammer) ein ; erwartet.<br />
Wenn ich aber statt dieser Klammer ein ; setze, steht, dass &quot;filename&quot; in Zeile 23 nicht definiert ist! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
<p>Bitte helft mir! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/281213/brauche-hilfe-bei-einem-programm</link><generator>RSS for Node</generator><lastBuildDate>Sun, 23 Aug 2026 20:00:10 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/281213.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 28 Jan 2011 16:03:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Brauche Hilfe bei einem Programm on Fri, 28 Jan 2011 16:10:09 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich versuche grade auf <a href="http://lazyfoo.net" rel="nofollow">lazyfoo.net</a> SDL zu lernen!</p>
<p>Bis jetzt ging alles gut ...</p>
<p>Ich hänge an folgendem Code:</p>
<pre><code>#include &lt;string&gt;
#include &lt;iostream&gt;
#include &quot;SDL.h&quot; 

using namespace std;

int main( int argc, char* args[]) 
{ 
	const int SCREEN_WIDTH = 640;
	const int SCREEN_HEIGHT = 320;
	const int SCREEN_BPP = 32;

	SDL_Surface *background=NULL;
	SDL_Surface *message=NULL;
	SDL_Surface *screen=NULL;

	[b]SDL_Surface *load_image( std::string filename ) {[/b] 

	SDL_Surface* loadedImage = NULL; 

	SDL_Surface* optimizedImage = NULL; 

	loadedImage = SDL_LoadBMP( filename.c_str() ); 

	if( loadedImage != NULL ) 
	{ 
	     optimizedImage = SDL_DisplayFormat( loadedImage ); 		
             SDL_FreeSurface( loadedImage );
	} 

	return optimizedImage; 
}
</code></pre>
<p>In Zeile 17 wird statt dem letzten Zeichen (geschwungene Klammer) ein ; erwartet.<br />
Wenn ich aber statt dieser Klammer ein ; setze, steht, dass &quot;filename&quot; in Zeile 23 nicht definiert ist! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
<p>Bitte helft mir! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2013643</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2013643</guid><dc:creator><![CDATA[SFandler]]></dc:creator><pubDate>Fri, 28 Jan 2011 16:10:09 GMT</pubDate></item><item><title><![CDATA[Reply to Brauche Hilfe bei einem Programm on Fri, 28 Jan 2011 16:16:20 GMT]]></title><description><![CDATA[<p>So?</p>
<pre><code class="language-cpp">#include &lt;string&gt;
#include &lt;iostream&gt;
#include &quot;SDL.h&quot;

using namespace std;

int main( int argc, char* args[])
{
    const int SCREEN_WIDTH = 640;
    const int SCREEN_HEIGHT = 320;
    const int SCREEN_BPP = 32;

    SDL_Surface *background=NULL;
    SDL_Surface *message=NULL;
    SDL_Surface *screen=NULL;
}

SDL_Surface *load_image( std::string filename ) { 

    SDL_Surface* loadedImage = NULL;

    SDL_Surface* optimizedImage = NULL;

    loadedImage = SDL_LoadBMP( filename.c_str() );

    if( loadedImage != NULL )
    {
         optimizedImage = SDL_DisplayFormat( loadedImage );        
             SDL_FreeSurface( loadedImage );
    }

    return optimizedImage;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2013647</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2013647</guid><dc:creator><![CDATA[manni66]]></dc:creator><pubDate>Fri, 28 Jan 2011 16:16:20 GMT</pubDate></item><item><title><![CDATA[Reply to Brauche Hilfe bei einem Programm on Fri, 28 Jan 2011 16:21:43 GMT]]></title><description><![CDATA[<p>Danke für die Antwort &amp; deine Hilfe!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2013649</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2013649</guid><dc:creator><![CDATA[SFandler]]></dc:creator><pubDate>Fri, 28 Jan 2011 16:21:43 GMT</pubDate></item></channel></rss>