<?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[Private Variable verändern]]></title><description><![CDATA[<p>ich hab hier ein problem bei dem ich einfach nicht weiterkomme.</p>
<pre><code>class a {
public:
 void change(std::string);
private:
static std::string a;
};

std::string a::a = &quot;a.exe&quot;;

void a::a(std::string path) {
a = path + a;
}
</code></pre>
<p>Es kommt imer wieder die fehlermeldung a wäre private... error within this context</p>
<p>Aber selbst wenn ich a public mache geht es nicht...</p>
<p>Wo liegt hier der Fehler?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/336337/private-variable-verändern</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Apr 2026 17:56:24 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/336337.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 16 Jan 2016 18:12:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Private Variable verändern on Sat, 16 Jan 2016 18:12:11 GMT]]></title><description><![CDATA[<p>ich hab hier ein problem bei dem ich einfach nicht weiterkomme.</p>
<pre><code>class a {
public:
 void change(std::string);
private:
static std::string a;
};

std::string a::a = &quot;a.exe&quot;;

void a::a(std::string path) {
a = path + a;
}
</code></pre>
<p>Es kommt imer wieder die fehlermeldung a wäre private... error within this context</p>
<p>Aber selbst wenn ich a public mache geht es nicht...</p>
<p>Wo liegt hier der Fehler?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2483486</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2483486</guid><dc:creator><![CDATA[chris013491]]></dc:creator><pubDate>Sat, 16 Jan 2016 18:12:11 GMT</pubDate></item><item><title><![CDATA[Reply to Private Variable verändern on Sat, 16 Jan 2016 18:16:27 GMT]]></title><description><![CDATA[<p>Klasse und Variable heissen a?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2483488</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2483488</guid><dc:creator><![CDATA[manni66]]></dc:creator><pubDate>Sat, 16 Jan 2016 18:16:27 GMT</pubDate></item><item><title><![CDATA[Reply to Private Variable verändern on Sat, 16 Jan 2016 19:10:57 GMT]]></title><description><![CDATA[<p>Kannst du erst einmal alles so nennen, wie es wirklich heißt? Dein change heißt beispielsweise mal change, mal a. Sprich: Kopier(!) bitte 1:1 den Code mit Fehlermeldung, anstatt hier im Forum zu &quot;programmieren&quot;. Da machst du nämlich bloß lauter Tippfehler, die nichts mit dem Problem zu tun haben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2483505</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2483505</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Sat, 16 Jan 2016 19:10:57 GMT</pubDate></item><item><title><![CDATA[Reply to Private Variable verändern on Sat, 16 Jan 2016 20:15:44 GMT]]></title><description><![CDATA[<pre><code>#ifndef LAUNCHER_HPP
#define LAUNCHER_HPP

#include &lt;map&gt;
#include &lt;string&gt;
#include &lt;windows.h&gt;

class launcher {
public:
 int start(std::string);
 std::string swd(std::string);
 int vlc_fullscreen(std::string);
 int vlc_minimized(std::string);
private:
 static std::string librePath;
 static std::string vlcPath;
};launcher *l;

int start(std::string path){
 std::map&lt;std::string, short int&gt;type;
  type[&quot;avi&quot;] = 2;
  type[&quot;doc&quot;] = 3;
  type[&quot;mkv&quot;] = 2;
  type[&quot;mp3&quot;] = 1;
  type[&quot;mp4&quot;] = 2;
  type[&quot;wav&quot;] = 1;

 if(type[path.substr(path.length()-3,3)] == 1) { l-&gt;vlc_fullscreen(path); }
 if(type[path.substr(path.length()-3,3)] == 2) { l-&gt;vlc_minimized(path); }
}

std::string swd(std::string mwd) {
 mwd = mwd.substr(0,mwd.rfind('\\')+1);
// librePath = '\&quot;' + mwd + librePath + '\&quot;';
 l-&gt;vlcPath = '\&quot;' + mwd + &quot;Apps\\VideoLAN\\VLC\\vlc.exe&quot; + '\&quot;';
 std::cout &lt;&lt; l-&gt;vlcPath;
 return mwd;
}

int vlc_fullscreen(std::string path) {
 path = &quot; -f \&quot;&quot; + path + '\&quot;';
  std::string a = l-&gt;vlcPath;
 ShellExecute(NULL,&quot;open&quot;,a.c_str(),path.c_str(),NULL,NULL);
}

int vlc_minimized(std::string path) {
 path = &quot; --qt-start-minimized \&quot;&quot; + path + '\&quot;';
 std::string a = l-&gt;vlcPath;
 ShellExecute(NULL,&quot;open&quot;,a.c_str(),path.c_str(),NULL,NULL);
}

#endif
</code></pre>
<p>zur erklärung statts l-&gt; sollte man this verwenden ich weis... funktioniert nur nicht...</p>
<p>und header und methoden sollte man trennen aber finde es so besser...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2483523</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2483523</guid><dc:creator><![CDATA[chris013491]]></dc:creator><pubDate>Sat, 16 Jan 2016 20:15:44 GMT</pubDate></item><item><title><![CDATA[Reply to Private Variable verändern on Sat, 16 Jan 2016 20:17:38 GMT]]></title><description><![CDATA[<p>code teilweise verändert in librepath und vlcPath sollte eigentlich noch der relative pfad stehen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2483524</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2483524</guid><dc:creator><![CDATA[chris013491]]></dc:creator><pubDate>Sat, 16 Jan 2016 20:17:38 GMT</pubDate></item><item><title><![CDATA[Reply to Private Variable verändern on Sat, 16 Jan 2016 20:20:38 GMT]]></title><description><![CDATA[<p>steht jetzt eben in der methode selber...<br />
und will die variable vlcPath z. B. dann verändern...<br />
krieg das nur nicht hin</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2483525</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2483525</guid><dc:creator><![CDATA[chris013491]]></dc:creator><pubDate>Sat, 16 Jan 2016 20:20:38 GMT</pubDate></item><item><title><![CDATA[Reply to Private Variable verändern on Sat, 16 Jan 2016 20:31:49 GMT]]></title><description><![CDATA[<p>So sollte es eigentlich aussehen...</p>
<pre><code>#ifndef LAUNCHER_HPP
#define LAUNCHER_HPP

#include &lt;map&gt;
#include &lt;string&gt;
#include &lt;windows.h&gt;

class launcher {
public:
 int start(std::string);
 std::string swd(std::string);
 int vlc_fullscreen(std::string);
 int vlc_minimized(std::string);
private:
 static std::string librePath;
 static std::string vlcPath;
};launcher *l;

std::string vlcPath = &quot;Apps\\VideoLAN\\VLC\\vlc.exe&quot;;

int start(std::string path){
 std::map&lt;std::string, short int&gt;type;
  type[&quot;avi&quot;] = 2;
  type[&quot;doc&quot;] = 3;
  type[&quot;mkv&quot;] = 2;
  type[&quot;mp3&quot;] = 1;
  type[&quot;mp4&quot;] = 2;
  type[&quot;wav&quot;] = 1;

 if(type[path.substr(path.length()-3,3)] == 1) { l-&gt;vlc_fullscreen(path); }
 if(type[path.substr(path.length()-3,3)] == 2) { l-&gt;vlc_minimized(path); }
}

std::string swd(std::string mwd) {
 mwd = mwd.substr(0,mwd.rfind('\\')+1);
// librePath = '\&quot;' + mwd + librePath + '\&quot;';
 vlcPath = '\&quot;' + mwd + vlcPath + '\&quot;';
 std::cout &lt;&lt; l-&gt;vlcPath;
 return mwd;
}

int vlc_fullscreen(std::string path) {
 path = &quot; -f \&quot;&quot; + path + '\&quot;';
 ShellExecute(NULL,&quot;open&quot;,librePath.c_str(),path.c_str(),NULL,NULL);
}

int vlc_minimized(std::string path) {
 path = &quot; --qt-start-minimized \&quot;&quot; + path + '\&quot;';
 ShellExecute(NULL,&quot;open&quot;,vlcPath.c_str(),path.c_str(),NULL,NULL);
}

#endif
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2483528</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2483528</guid><dc:creator><![CDATA[chris01349]]></dc:creator><pubDate>Sat, 16 Jan 2016 20:31:49 GMT</pubDate></item><item><title><![CDATA[Reply to Private Variable verändern on Sat, 16 Jan 2016 20:33:09 GMT]]></title><description><![CDATA[<p>zur erklärung nochmal damit man den code versteht<br />
mwd ist hier gleich argv[0]...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2483530</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2483530</guid><dc:creator><![CDATA[chris01349]]></dc:creator><pubDate>Sat, 16 Jan 2016 20:33:09 GMT</pubDate></item><item><title><![CDATA[Reply to Private Variable verändern on Sat, 16 Jan 2016 20:39:04 GMT]]></title><description><![CDATA[<p>I:\Neuer Ordner (2)\launcher.hpp||In function 'std::string swd(std::string)':|<br />
I:\Neuer Ordner (2)\launcher.hpp|16|error: 'std::string launcher::vlcPath' is private|<br />
I:\Neuer Ordner (2)\launcher.hpp|38|error: within this context|<br />
I:\Neuer Ordner (2)\launcher.hpp||In function 'int vlc_fullscreen(std::string)':|<br />
I:\Neuer Ordner (2)\launcher.hpp|44|error: 'librePath' was not declared in this scope|<br />
I:\Neuer Ordner (2)\launcher.hpp||In function 'int vlc_minimized(std::string)':|<br />
I:\Neuer Ordner (2)\launcher.hpp|49|warning: passing NULL to non-pointer argument 6 of 'HINSTANCE__* ShellExecuteA(HWND, LPCSTR, LPCSTR, LPCSTR, LPCSTR, INT)' [-Wconversion-null]|<br />
||=== Build failed: 3 error(s), 1 warning(s) (0 minute(s), 0 second(s)) ===|</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2483532</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2483532</guid><dc:creator><![CDATA[chris01349]]></dc:creator><pubDate>Sat, 16 Jan 2016 20:39:04 GMT</pubDate></item><item><title><![CDATA[Reply to Private Variable verändern on Sat, 16 Jan 2016 20:40:08 GMT]]></title><description><![CDATA[<p>Zeile 44 sollte statts librePath vlcPath heißen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2483533</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2483533</guid><dc:creator><![CDATA[chris01349]]></dc:creator><pubDate>Sat, 16 Jan 2016 20:40:08 GMT</pubDate></item><item><title><![CDATA[Reply to Private Variable verändern on Sat, 16 Jan 2016 20:44:14 GMT]]></title><description><![CDATA[<p>Woher soll der Compiler wissen, wozu die unten definierten funktionen gehören bzw ob sie überhaupt zu irgendeiner klasse gehören?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2483535</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2483535</guid><dc:creator><![CDATA[Techel]]></dc:creator><pubDate>Sat, 16 Jan 2016 20:44:14 GMT</pubDate></item><item><title><![CDATA[Reply to Private Variable verändern on Sat, 16 Jan 2016 20:52:12 GMT]]></title><description><![CDATA[<p>okai thx<br />
<img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /> einfach vergessen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2483537</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2483537</guid><dc:creator><![CDATA[chris01349]]></dc:creator><pubDate>Sat, 16 Jan 2016 20:52:12 GMT</pubDate></item></channel></rss>