Mail Archives: djgpp/1997/03/13/19:06:22
In article <5g9p1b$fac AT netra DOT montana DOT edu>,
Paul Peavyhouse <pv AT cs DOT montana DOT edu> wrote:
[this didn't work for Paul]
>DATAFILE *terra;
>
> int main (int c, char **v)
> {
> terra = load_datafile("terra.dat");
> char *str;
> }
>
[but this one did work for Paul]
>
>DATAFILE *terra;
>
> int main (int c, char **v)
> {
> char *str;
> terra = load_datafile("terra.dat");
> }
>
Maybe you've found another difference between C and C++. In C,
variables need to be declared at the beginning of a function;
with C++, this isn't the case. Did you compile these as C
programs when you really meant to compile them as C++ programs?
What error messages did you receive?
> ...IT WORKS?!?!?! I can live with writing it this way, but I want to
>know why the compiler pukes when I write it the other way. Can any help me
>here? I'd appreciate it!
[daydreaming]
(I wish comp.lang.asm.x86 would be liberated... I miss it.)
--
beppu AT uci DOT edu .............................................................
- Raw text -