Re: [OT] Visual C++ help

new topic     » goto parent     » topic index » view thread      » older message » newer message

I think the problem is, that repeat,
string strclass::repeat(char ch,int rep)
{
  string ret = "";
  for (int c=0;c<rep;c++)
  {
     ret += ch;
  }
  return ret;
}
this is not the way to grow a string, definity not. The best way is to make
a macro to define a long string(255) of zeros, then use the repeat on it to
put in it what you want.
eg.

string a[255];

string strclass::repeat(char ch,int rep)
{
  string ret = "";
  for (int c=0;c<rep;c++)
  {
     ret[c]= ch;
  }
  return ret;
}

----- Original Message ----- 
From: <fred at jordah.freeserve.co.uk>
To: "EUforum" <EUforum at topica.com>
Sent: Monday, May 12, 2003 9:27 PM
Subject: [OT] Visual C++ help


>
> Hi all,
>    anyone willing to help me with this question?
>
http://logicsoft.pcplayground.com/modules.php?name=Forums&file=viewtopic&t=4
>
> Jordah
>
>
>
> TOPICA - Start your own email discussion group. FREE!
>
>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu