runtime error
-
FILE *f_ptr22[50]; CString ftitle[50]; for (i=0;i<50;i++) { f_ptr22[i]=NULL; } for (i=0;i<nfile;i++) { f_ptr22[i] = fopen(ftitle[i],"r"); } I got "debug Assertion failed at f_ptr22[i] = fopen(ftitle[i],"r"); Expression *file!=_T('\o') Please help: what is the problem here. Code compiled OK. Thanks
-
FILE *f_ptr22[50]; CString ftitle[50]; for (i=0;i<50;i++) { f_ptr22[i]=NULL; } for (i=0;i<nfile;i++) { f_ptr22[i] = fopen(ftitle[i],"r"); } I got "debug Assertion failed at f_ptr22[i] = fopen(ftitle[i],"r"); Expression *file!=_T('\o') Please help: what is the problem here. Code compiled OK. Thanks
You never initialize
ftitle
. BTW why do you try to open again and again the same file? :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
FILE *f_ptr22[50]; CString ftitle[50]; for (i=0;i<50;i++) { f_ptr22[i]=NULL; } for (i=0;i<nfile;i++) { f_ptr22[i] = fopen(ftitle[i],"r"); } I got "debug Assertion failed at f_ptr22[i] = fopen(ftitle[i],"r"); Expression *file!=_T('\o') Please help: what is the problem here. Code compiled OK. Thanks
Both
for()
loops usei
, why? What is the value ofi
when the assertion fires?"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
Both
for()
loops usei
, why? What is the value ofi
when the assertion fires?"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius