Click here to Skip to main content
15,920,508 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionim just learning to prgram and have troubleing starting this question Pin
bigtimer102214-Mar-07 12:32
bigtimer102214-Mar-07 12:32 
AnswerRe: im just learning to prgram and have troubleing starting this question Pin
Bram van Kampen14-Mar-07 16:30
Bram van Kampen14-Mar-07 16:30 
AnswerRe: im just learning to prgram and have troubleing starting this question Pin
_AnsHUMAN_ 14-Mar-07 18:52
_AnsHUMAN_ 14-Mar-07 18:52 
GeneralRe: im just learning to prgram and have troubleing starting this question Pin
bigtimer102214-Mar-07 18:54
bigtimer102214-Mar-07 18:54 
GeneralRe: im just learning to prgram and have troubleing starting this question Pin
_AnsHUMAN_ 14-Mar-07 19:03
_AnsHUMAN_ 14-Mar-07 19:03 
GeneralRe: im just learning to prgram and have troubleing starting this question Pin
bigtimer102214-Mar-07 19:03
bigtimer102214-Mar-07 19:03 
QuestionSimple Problem? Blind Author cant see? Pin
LeighRogers14-Mar-07 11:50
LeighRogers14-Mar-07 11:50 
AnswerRe: Simple Problem? Blind Author cant see? Pin
John R. Shaw14-Mar-07 15:33
John R. Shaw14-Mar-07 15:33 
I think the problem is the following:
count++; // WRONG!
Playlist[count] = new Mp3(artist, track, length);

Try this:
Playlist[count] = new Mp3(artist, track, length);
count++;

Or this:
Playlist[count++] = new Mp3(artist, track, length);


The first is wrong because you start by filling in Playlist[1] instead of PlayList[0]. Also at the end you will be filling in slot Playlise[iNo], which does not exist. As a further check in your loop, you may what to use while( !in.eof() && count < iNo ) as additional safety; although the way it is written now, that will not help.

The actual cause of an error is not always reported when it occurs, so remember to work backwards from the error (what happen before it).

P.S. Prefer ++count to count++, because if those operators are ever overload the difference will give you headaches.



INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra

AnswerRe: Simple Problem? Blind Author cant see? Pin
Hamid_RT14-Mar-07 19:15
Hamid_RT14-Mar-07 19:15 
QuestionNeed help communicating with MFC dialog boxes (domodal) [modified] Pin
CoffeeAddict1914-Mar-07 11:10
CoffeeAddict1914-Mar-07 11:10 
AnswerRe: Need help communicating with MFC dialog boxes (domodal) Pin
toxcct14-Mar-07 11:23
toxcct14-Mar-07 11:23 
GeneralRe: Need help communicating with MFC dialog boxes (domodal) Pin
andersod214-Mar-07 12:27
andersod214-Mar-07 12:27 
GeneralRe: Need help communicating with MFC dialog boxes (domodal) [modified] Pin
CoffeeAddict1914-Mar-07 18:24
CoffeeAddict1914-Mar-07 18:24 
GeneralRe: Need help communicating with MFC dialog boxes (domodal) Pin
andersod214-Mar-07 18:42
andersod214-Mar-07 18:42 
GeneralRe: Need help communicating with MFC dialog boxes (domodal) Pin
andersod214-Mar-07 13:13
andersod214-Mar-07 13:13 
GeneralRe: Need help communicating with MFC dialog boxes (domodal) Pin
toxcct14-Mar-07 22:07
toxcct14-Mar-07 22:07 
GeneralRe: Need help communicating with MFC dialog boxes (domodal) Pin
andersod215-Mar-07 10:30
andersod215-Mar-07 10:30 
Questionpassing function pointer Pin
ScotDolan14-Mar-07 10:53
ScotDolan14-Mar-07 10:53 
AnswerRe: passing function pointer Pin
Mark Salsbery14-Mar-07 11:42
Mark Salsbery14-Mar-07 11:42 
GeneralRe: passing function pointer Pin
ThatsAlok14-Mar-07 19:34
ThatsAlok14-Mar-07 19:34 
GeneralRe: passing function pointer Pin
Mark Salsbery14-Mar-07 20:13
Mark Salsbery14-Mar-07 20:13 
GeneralRe: passing function pointer Pin
ThatsAlok14-Mar-07 20:20
ThatsAlok14-Mar-07 20:20 
QuestionGet users names list Pin
Caos00014-Mar-07 9:59
Caos00014-Mar-07 9:59 
AnswerRe: Get users names list Pin
Mark Salsbery14-Mar-07 10:32
Mark Salsbery14-Mar-07 10:32 
AnswerRe: Get users names list Pin
ThatsAlok14-Mar-07 19:35
ThatsAlok14-Mar-07 19:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.