<?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[char array ??]]></title><description><![CDATA[<p>Hi<br />
ich hab ein kleines programm des aus einem txt file bestimte zeilen raussucht und in ein anderes file schreibt allerdings muss ich die zeilen auch noch abändern Bsp.:</p>
<blockquote>
<blockquote>
<p>Connecting to <a href="http://pop.web.de" rel="nofollow">pop.web.de</a>...<br />
USER user @web.de</p>
</blockquote>
<p>From: &quot;<a href="http://WEB.DE" rel="nofollow">WEB.DE</a> informiert&quot; &lt;neu @web.de&gt;<br />
Date: Wed, 21 Jun 2006 15:09:44 +0200</p>
</blockquote>
<p>ich will aber nur</p>
<blockquote>
<p><a href="http://pop.web.de" rel="nofollow">pop.web.de</a>...<br />
user @web.de</p>
<p>neu @web.de<br />
Wed, 21 Jun 2006 15:09:44</p>
</blockquote>
<p>jetzt ist das problemm das ich keine ahnung hab wie ich das mache wenn die zeilen in char arrays sind???<br />
hier mal der code.</p>
<pre><code class="language-cpp">#include &lt;stdio.h&gt;
#include &lt;string.h&gt;
#include &lt;stdlib.h&gt;

int main() {

   char inhalt[100];
   char *temp;

   FILE *f;
   FILE *f_n;

   f_n = fopen(&quot;new.txt&quot;, &quot;r+&quot;);
   f = fopen(&quot;test.txt&quot;, &quot;r&quot;);

   if(f == NULL) {
      printf(&quot;Fehler bei fopen()... \n&quot;);
      return EXIT_FAILURE;
   }
   fgets(inhalt, BUFSIZ, f);

//bis ende datei  
while(!feof(f)) {

   //schleife für einen account
   while(1){   

           //suche &quot;&gt;Connecting&quot;
           do {
              fgets(inhalt, BUFSIZ, f);   
              if(strstr(inhalt, &quot;&gt;Connecting&quot;) != NULL){
                  //temp = strcspn( inhalt, &quot;\t&quot; );

                  printf(inhalt);
                  fputs(inhalt, f_n);

              }              
           }while(strstr(inhalt, &quot;&gt;Connecting&quot;) == NULL);
           //suche &quot;&gt;USER&quot;
           do {
              fgets(inhalt, BUFSIZ, f);   
              if(strstr(inhalt, &quot;&gt;USER&quot;) != NULL){
                  printf(inhalt);
                  fputs(inhalt, f_n);

              }              
           } while(strstr(inhalt, &quot;&gt;USER&quot;) == NULL);

       while(strstr(inhalt, &quot;successful&quot;) == NULL){
           char temp[100] = &quot;&quot;;                
           //suche &quot;*******&quot;
           while(1) {
               fgets(inhalt, BUFSIZ, f);   
               if(strstr(inhalt, &quot;successful&quot;) != NULL) break; 
               if(strstr(inhalt, &quot;*************&quot;) != NULL){
                    printf(inhalt);

                    break;
               }

           } 

           if(strstr(inhalt, &quot;successful&quot;) != NULL) break; 

           //suche &quot;From:&quot;
           while(1) {
               fgets(inhalt, BUFSIZ, f);
               if(strstr(inhalt, &quot;successful&quot;) != NULL) break; 
               if(strstr(inhalt, &quot;From:&quot;) != NULL){
                    //strcat(temp, inhalt);
                    temp = strrchr(string, '&gt;');
                    *temp = '';
                    printf(inhalt);
                    fputs(inhalt, f_n);
                    break;
               }              

           } 

           if(strstr(inhalt, &quot;successful&quot;) != NULL) break; 

           //suche &quot;Date:&quot;
           while(1) {
               fgets(inhalt, BUFSIZ, f);   
               if(strstr(inhalt, &quot;successful&quot;) != NULL) break; 
               if(strstr(inhalt, &quot;Date:&quot;) != NULL){
                    strcat(temp, inhalt);
                  //  strcat(temp, inhalt);
                    printf(inhalt);
                    fputs(inhalt, f_n);
                    break;
               }     

           } 

       }

   }
/* TODO (#1#): csv datei schreiben */

   printf(&quot;ender der ersten account schleife&quot;);

}
   system (&quot;pause&quot;);
   return EXIT_SUCCESS;
}
 //if(strstr(inhalt, &quot;The operation was successful&quot;) != NULL) break;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/167628/char-array</link><generator>RSS for Node</generator><lastBuildDate>Wed, 16 Sep 2026 00:28:34 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/167628.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 13 Dec 2006 09:00:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to char array ?? on Wed, 13 Dec 2006 09:00:25 GMT]]></title><description><![CDATA[<p>Hi<br />
ich hab ein kleines programm des aus einem txt file bestimte zeilen raussucht und in ein anderes file schreibt allerdings muss ich die zeilen auch noch abändern Bsp.:</p>
<blockquote>
<blockquote>
<p>Connecting to <a href="http://pop.web.de" rel="nofollow">pop.web.de</a>...<br />
USER user @web.de</p>
</blockquote>
<p>From: &quot;<a href="http://WEB.DE" rel="nofollow">WEB.DE</a> informiert&quot; &lt;neu @web.de&gt;<br />
Date: Wed, 21 Jun 2006 15:09:44 +0200</p>
</blockquote>
<p>ich will aber nur</p>
<blockquote>
<p><a href="http://pop.web.de" rel="nofollow">pop.web.de</a>...<br />
user @web.de</p>
<p>neu @web.de<br />
Wed, 21 Jun 2006 15:09:44</p>
</blockquote>
<p>jetzt ist das problemm das ich keine ahnung hab wie ich das mache wenn die zeilen in char arrays sind???<br />
hier mal der code.</p>
<pre><code class="language-cpp">#include &lt;stdio.h&gt;
#include &lt;string.h&gt;
#include &lt;stdlib.h&gt;

int main() {

   char inhalt[100];
   char *temp;

   FILE *f;
   FILE *f_n;

   f_n = fopen(&quot;new.txt&quot;, &quot;r+&quot;);
   f = fopen(&quot;test.txt&quot;, &quot;r&quot;);

   if(f == NULL) {
      printf(&quot;Fehler bei fopen()... \n&quot;);
      return EXIT_FAILURE;
   }
   fgets(inhalt, BUFSIZ, f);

//bis ende datei  
while(!feof(f)) {

   //schleife für einen account
   while(1){   

           //suche &quot;&gt;Connecting&quot;
           do {
              fgets(inhalt, BUFSIZ, f);   
              if(strstr(inhalt, &quot;&gt;Connecting&quot;) != NULL){
                  //temp = strcspn( inhalt, &quot;\t&quot; );

                  printf(inhalt);
                  fputs(inhalt, f_n);

              }              
           }while(strstr(inhalt, &quot;&gt;Connecting&quot;) == NULL);
           //suche &quot;&gt;USER&quot;
           do {
              fgets(inhalt, BUFSIZ, f);   
              if(strstr(inhalt, &quot;&gt;USER&quot;) != NULL){
                  printf(inhalt);
                  fputs(inhalt, f_n);

              }              
           } while(strstr(inhalt, &quot;&gt;USER&quot;) == NULL);

       while(strstr(inhalt, &quot;successful&quot;) == NULL){
           char temp[100] = &quot;&quot;;                
           //suche &quot;*******&quot;
           while(1) {
               fgets(inhalt, BUFSIZ, f);   
               if(strstr(inhalt, &quot;successful&quot;) != NULL) break; 
               if(strstr(inhalt, &quot;*************&quot;) != NULL){
                    printf(inhalt);

                    break;
               }

           } 

           if(strstr(inhalt, &quot;successful&quot;) != NULL) break; 

           //suche &quot;From:&quot;
           while(1) {
               fgets(inhalt, BUFSIZ, f);
               if(strstr(inhalt, &quot;successful&quot;) != NULL) break; 
               if(strstr(inhalt, &quot;From:&quot;) != NULL){
                    //strcat(temp, inhalt);
                    temp = strrchr(string, '&gt;');
                    *temp = '';
                    printf(inhalt);
                    fputs(inhalt, f_n);
                    break;
               }              

           } 

           if(strstr(inhalt, &quot;successful&quot;) != NULL) break; 

           //suche &quot;Date:&quot;
           while(1) {
               fgets(inhalt, BUFSIZ, f);   
               if(strstr(inhalt, &quot;successful&quot;) != NULL) break; 
               if(strstr(inhalt, &quot;Date:&quot;) != NULL){
                    strcat(temp, inhalt);
                  //  strcat(temp, inhalt);
                    printf(inhalt);
                    fputs(inhalt, f_n);
                    break;
               }     

           } 

       }

   }
/* TODO (#1#): csv datei schreiben */

   printf(&quot;ender der ersten account schleife&quot;);

}
   system (&quot;pause&quot;);
   return EXIT_SUCCESS;
}
 //if(strstr(inhalt, &quot;The operation was successful&quot;) != NULL) break;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1191030</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1191030</guid><dc:creator><![CDATA[bolu]]></dc:creator><pubDate>Wed, 13 Dec 2006 09:00:25 GMT</pubDate></item><item><title><![CDATA[Reply to char array ?? on Wed, 13 Dec 2006 09:08:11 GMT]]></title><description><![CDATA[<p>Die Zeichen des char-Arrays stehen einfach hintereinander im Speicher (wobei die meisten String-Funktionen so lange weiterlesen, bis sie auf ein '\0' treffen). Also kannst du mit einfacher Zeiger-Arithmetik weiterkommen - z.B. beginnt der Name des Servers in der ersten Eingabezeile bei <code>inhalt+15</code> .</p>
<p>PS: Und eventuell solltest du auf C++ Mittel umsteigen und fstream und string verwenden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1191038</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1191038</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Wed, 13 Dec 2006 09:08:11 GMT</pubDate></item><item><title><![CDATA[Reply to char array ?? on Wed, 13 Dec 2006 10:53:16 GMT]]></title><description><![CDATA[<p>kennst du zufälig die syntax von fstream oder ne page auf der die steht???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1191097</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1191097</guid><dc:creator><![CDATA[bolu]]></dc:creator><pubDate>Wed, 13 Dec 2006 10:53:16 GMT</pubDate></item><item><title><![CDATA[Reply to char array ?? on Wed, 13 Dec 2006 10:55:55 GMT]]></title><description><![CDATA[<p>bolu schrieb:</p>
<blockquote>
<p>kennst du zufälig die syntax von fstream oder ne page auf der die steht???</p>
</blockquote>
<p>also bei mir hat google soviele gute seiten gefunden, und da habe ich nur fstream eingegeben...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1191098</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1191098</guid><dc:creator><![CDATA[ser1al_ausgeloggt]]></dc:creator><pubDate>Wed, 13 Dec 2006 10:55:55 GMT</pubDate></item><item><title><![CDATA[Reply to char array ?? on Wed, 13 Dec 2006 10:59:32 GMT]]></title><description><![CDATA[<p>Schau mal ins Magazin, dort habe ich einen recht ausführlichen Artikel über IO-Streams geschrieben - eventuell hilft der dir weiter. (und einen über den Umgang mit Strings)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1191101</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1191101</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Wed, 13 Dec 2006 10:59:32 GMT</pubDate></item><item><title><![CDATA[Reply to char array ?? on Wed, 13 Dec 2006 11:13:29 GMT]]></title><description><![CDATA[<p>danke für eure schnellen antworten und jetzt wieder an die arbeit sonst giebts ärger vom chef <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="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1191108</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1191108</guid><dc:creator><![CDATA[bolu]]></dc:creator><pubDate>Wed, 13 Dec 2006 11:13:29 GMT</pubDate></item></channel></rss>