I just tried with g++ and it did not produce any error:
$ g++ --version
i686-apple-darwin8-g++-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367)
$ g++ -Wall main.c
$ ./a.out
Type: Posts; User: melkor445
I just tried with g++ and it did not produce any error:
$ g++ --version
i686-apple-darwin8-g++-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367)
$ g++ -Wall main.c
$ ./a.out
This is just to demonstrate what I mean, but in practice I will be writing a program that is very large in which I might accidently call functions with the wrong type of arguments, so need a way to...
Hi,
I am new to programming in C, but (as a scientist) have a lot of programming experience in Fortran 95.
I am trying to figure out how to get the compiler to raise an error if a function is...
Ok, I think I see what you mean. Thinking about it I don't have a good reason for the arrays to be globally available. And I can easily know the size of the array I will require before the first...
For the purposes of my program, I require several 3D (and 6D) arrays to be globally accessible from a specific class, but I don't know what it's dimensions are until runtime. Once allocated I don't...
Speed is an issue, but I would not sacrifice code simplicity for only say a factor of 2 or less improvement. And this method does seem pretty simple code-wise.
From what I've read about vectors,...
Ok, thanks!
So say that we didn't care about code aesthetics (although I do in reality!), and wrote this using vectors of vectors of vectors etc. as you suggested, what kind of speed gain are we...
not forgetting semicolons in the above of course...
Thanks for your comments!
I decided not to put the allocation inside the constructor, because I want to allocate the array separately from declaring it.
Regarding the destructor, I am wandering...
Hi everyone,
I am currently learning c++ (but having programmed in fortran 95 before, it is mostly a case of learning new syntax, and a few new concepts, in order to be familiar with the basics)....