Mail Archives: djgpp/1994/03/15/16:00:56
Well, the mystery gives way... The problem can be summed up in a few lines
of code... (my fault for being sloppy in the first place:) )
#include <Complex.h>
#include <iostream.h>
Complex *u;
int main(void)
{
float z=5.0;
u = new Complex[z];
cout<<"Watch me Abort!\n";
return 1;
}
This code will make the compiler Abort! with no warning messages.
I found this error when (I forgot exactly who suggested this - Thanks to
who ever it was!) I tried to compile my code on the RS/6000 xlC compiler.
The error that compiler gave was
"float" cannot be converted to "int"
"float*" cannot be converted to "complex*"
So if I just say
u = new Complex[int(z)];
everything works great!
It was a dumb mistake, but I sure wish the compiler would give a better
warning then "Abort!"
Thanks to all who helped me! DJ - I hope you see this note before you spend
too much time playing with my code!
Sincerely,
Jon Nash
Tesla AT Lamar DOT ColoState DOT EDU
Colorado State University
Physics Department
- Raw text -