qt-interest@trolltech.com
[Top] [All Lists]

Re: Nee some help with a array. But non Qt.

Subject: Re: Nee some help with a array. But non Qt.
From: Sven Alisch
Date: Sun, 20 Mar 2005 17:04:51 +0100
Hello Hans,

This is very easy to handle with memset.

Example:
 memset(your_array,'the sign',size_of_your_array);

look at: http://www.cppreference.com/stdstring/memset.html

Alternativ:
better is:
void fill(const char what,char* block, unsigned long& howbig)
{
 ...
}

regards,
 Sven

Am Sonntag, 20. März 2005 15:34 schrieb Hans Müller:
> I have the problem the i need a reference of an char[].
> here my bad code:
>
>
> vod fill(const char &what,char &block[],unsigned long &howbig)
> {
>  for for (unsigned long x=0;x<howbig;x++)
>  {
>   block[x]=what;
>  }
> }
>
> this will not compile with the error: error: declaration of `block' as
> array of references:( Who must I write this???

--
List archive and information: http://lists.trolltech.com/qt-interest/

<Prev in Thread] Current Thread [Next in Thread>