<?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[Records bzw Strukturen Problem]]></title><description><![CDATA[<p>Hallo Leute ich bin neu hier hab aber gleich mal ne frage:</p>
<p>Quelltext<br />
typedef struct Autos<br />
{ char vorname[31], nachname[31];<br />
char strasse[26];<br />
int postleitzahl;<br />
char wohnort[21];<br />
char telefon [15];<br />
int alter; } Mensch;<br />
Mensch *Auto1;</p>
<p>void main(void)<br />
{<br />
int iA;<br />
int iB;<br />
char C[30];</p>
<p>Auto1-&gt;alter=14;</p>
<p>getch();</p>
<p>}</p>
<p>Wenn ich diesen Quelltext compilieren will bekomme ich einen zugriffsfehler</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/181651/records-bzw-strukturen-problem</link><generator>RSS for Node</generator><lastBuildDate>Tue, 22 Sep 2026 10:24:08 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/181651.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 15 May 2007 19:35:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Records bzw Strukturen Problem on Tue, 15 May 2007 19:35:44 GMT]]></title><description><![CDATA[<p>Hallo Leute ich bin neu hier hab aber gleich mal ne frage:</p>
<p>Quelltext<br />
typedef struct Autos<br />
{ char vorname[31], nachname[31];<br />
char strasse[26];<br />
int postleitzahl;<br />
char wohnort[21];<br />
char telefon [15];<br />
int alter; } Mensch;<br />
Mensch *Auto1;</p>
<p>void main(void)<br />
{<br />
int iA;<br />
int iB;<br />
char C[30];</p>
<p>Auto1-&gt;alter=14;</p>
<p>getch();</p>
<p>}</p>
<p>Wenn ich diesen Quelltext compilieren will bekomme ich einen zugriffsfehler</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1285750</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1285750</guid><dc:creator><![CDATA[Chuwbi]]></dc:creator><pubDate>Tue, 15 May 2007 19:35:44 GMT</pubDate></item><item><title><![CDATA[Reply to Records bzw Strukturen Problem on Tue, 15 May 2007 19:50:24 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Du greifst auf den Pointer Auto1 zu obwohl keine gültige Instanz zugewiesen wurde.<br />
Und noch ein paar Hinweise</p>
<pre><code class="language-cpp">struct Mensch // typedef ist für diesen Zweck alter C-Style
{ 
  char vorname[31], 
  nachname[31];
  char strasse[26];
  int postleitzahl;
  char wohnort[21];
  char telefon [15];
  int alter; 
};

int main() // Korrekte main-Funktion
{
  Mensch Mensch1; // Kein globales Object und kein Pointer
  Mensch1.alter = 14;

  Mensch *Mensch2 // Kein globales Object aber Pointer, noch ohne Instanz
  Mensch2-&gt;alter = 14; // Fehler!
  Mensch2 = new Mensch; // Instanz erstellen und zuweisen
  Mensch2-&gt;alter = 14; // Richtig
  delete Mensch2; // Instanz wieder freigeben, weil wird nicht automatisch gemacht
  Mensch2-&gt;alter = 14; // Fehler, nicht mehr gültig!

  getch();
}
</code></pre>
<p>Und noch sfds</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1285754</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1285754</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Tue, 15 May 2007 19:50:24 GMT</pubDate></item><item><title><![CDATA[Reply to Records bzw Strukturen Problem on Tue, 15 May 2007 19:50:37 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile-var-mode-is-viewprofile-and-u-is-14774.html" rel="nofollow">akari</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-2.html" rel="nofollow">VCL/CLX (Borland C++ Builder)</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-15.html" rel="nofollow">C++</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39405.html" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1285755</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1285755</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Tue, 15 May 2007 19:50:37 GMT</pubDate></item><item><title><![CDATA[Reply to Records bzw Strukturen Problem on Wed, 16 May 2007 06:41:31 GMT]]></title><description><![CDATA[<p>Chuwbi schrieb:</p>
<blockquote>
<pre><code class="language-cpp">typedef struct Autos
{ ... } Mensch;
</code></pre>
</blockquote>
<p>Was soll man zu dieser Namenswahl noch sagen ... *scnr*</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1285866</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1285866</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Wed, 16 May 2007 06:41:31 GMT</pubDate></item></channel></rss>