0
0

Hi,
I have a class with some members:

[code:t7e29ix2]class MyClass
{
bla bla
private:
/* the name of the sound track */
QString soundName;
FMOD::Sound *sound;
FMOD_SOUND_FORMAT m_soundFormat;
FMOD_SOUND_TYPE m_soundType;
bla bla
}[/code:t7e29ix2]

in the ctor I would initialize m_soundFormat and m_soundType so:
[code:t7e29ix2]MyClass::MyClass( QString soundName_, int numCPages )
: soundName( soundName_ ),
m_soundFormat( 0 ),
m_soundType( 0 )
{

}[/code:t7e29ix2]

but the compiler give to me error of initialization, so how can I initialize that types?

Best Regards,
Franco

  • You must to post comments
0
0

You cannot assign an int to an enum. Each enum is it’s own type and the only acceptable values are those from that enumeration.

[code:3lyu1tkq]MyClass::MyClass( QString soundName_, int numCPages )
: soundName( soundName_ ),
m_soundFormat( FMOD_SOUND_FORMAT_NONE ),
m_soundType( FMOD_SOUND_TYPE_UNKNOWN )
{

}[/code:3lyu1tkq]

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.