QByteArray error
-
this line of code gave me the error : expected primary-expression before ‘)’ token
@
QByteArray buff = new QByteArray(cnt, Qt::Initialization);
@how come? cnt is an input passed into the function...
-
Hi,
QByteArray has these four constructors:
@
QByteArray ()
QByteArray ( const char * str )
QByteArray ( const char * data, int size )
QByteArray ( int size, char ch )
@I cannot find Qt::Initialization in Qt documentation, so I guess you're using QByteArray in a wrong way. Maybe you mean QByteArray(cnt)????
T.
-
I see that in the document as well but when I am programming, the intellisense pops up with 7 constructors...
-
I see ...
anyway, Qt documentation comes first when you need to check if you're right or wrong :)
T.
-
phamtv, this constructor constructs a byte array with uninitialized contents. For internal usage.
-
You are also assigning a pointer to a non-pointer... but I guess that is not the issue you are asking about:-)