www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/28/15:42:06

From: "Al Morgan" <killallhumans AT hotmail DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Changing Text with Iteration...
Date: Sun, 26 Dec 1999 20:57:36 -0800
Organization: Posted via Supernews, http://www.supernews.com
Lines: 44
Message-ID: <s6ds8d53h4579@corp.supernews.com>
References: <83ve6e$bur$1 AT bob DOT news DOT rcn DOT net>
X-Complaints-To: newsabuse AT supernews DOT com
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I don't use that header file, so I can't help with the rest of the program,
but dont' you want to:

#include <string.h>

(with emphisis on the .h).

Tom <thomasbd AT erols DOT com> wrote in message
news:83ve6e$bur$1 AT bob DOT news DOT rcn DOT net...
> Can anyone tell me what is wrong with the following code?  I am trying to
> load a mp3 playlist into memory and then change each "\" to a "/" so it
can
> be read by the software I am using.  I can only get the first line to
work.
> I am trying to assign each line to a number with the string a[int].
Please
> help.  Thanks.
>
> #include <fstream>
> #include <string>
>
> int main()
> {
> string a[500];
> string s;
> int n = 0;
> int m = -1;
> ifstream inputfile("mylist.m3u");
> while ( getline( inputfile, s) )
> {
> while (s[++m])
> {
> if (s[m] == (char) 92)
> s[m] = (char) 47;
> }
> a[++n]=s;
> cout << n << ". " << a[n] << endl;
> }
> return 0;
> }
>
>


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019