Ahh, I get it now, thanks.
Type: Posts; User: Nextstopearth
Ahh, I get it now, thanks.
For that last function declaration, my reasoning would be that, if a double * was passed to it,
T **************************************** arg would now actually be
double *...
Well apparently there are things going on here that I am not aware of. For example:
template <typename T>
void func(T arg);
If you call func with
func(3);
Type *
That doesn't help me...I know Type is supposed to be double. I just don't see why. Again, if you are sending a double * as an argument, and then declaring a pointer to that, how is A not a pointer to...
I am confused then. If Type is double *, and we have Type *A, it seems like A would be a double **.
Since array is double * in both cases, how does Type end up being double in version 2?
Thank you. Elysia, what else needs to be done than just implement operator<<()?
Edit:
I think I know what you mean now. myobj is a std::vector. I realize now that that makes my code example a...
if I want to do this
std::copy(myobj.begin(),myobj.end(),std::ostream_iterator<myobjtype>(std::cout, "\n");
What method do I have to overload in myobjtype to get this to work? Is it...
Thank you.
Hmm I see, thanks. I thought the #ifndef directive would have kept it from being defined more than once for the whole program. So things defined with #define are only visible to the file they are in...
Multiple definitions of "board". Here are my files.
main.cpp
#include <stdlib.h>
#include "global_functions.h"
int main(int argc, char** argv) {
initialize_game();
return...
Oh I see. Thanks
While browsing a c++ faq I came across this comparison with C and found something I either didn't know or am reading wrong.
[6.11] Is C++ backward compatible with ANSI/ISO C?
Almost.
C++...
I changed incat() so that it returns char * so I can do something like
str = incat(str);
That works fine if str was initialized by instring(), but something like
char * str = "Hello";
Ahh, thats right, I get it now. Thanks.
After I posted the code I saw that a bunch of extra space was added so I edited it out, but I must have accidentally gotten a semicolon.
zacs7- thanks for the tips. I realize the pointer returned...
What I want to do is to get a string from input without having to guess at the size of the array needed beforehand, and be able to concatenate a new input string on the end of it, something like...
I almost feel bad posting such a horrible looking and long piece of code, but IF anybody feels like flexing their programming muscles a little and helping me out, I would really appreciate it. This...
This is the beginning of an avl tree project. I've never heard of a segmentation fault before now, but after some reading I guess is has something to do with read/writing is a specific point in...
c99 doesn't seem like it has been much of a priority as a standard to implement since it was published, am I right? GCC implements some but not all of it, VC++ doesn't support it (I don't think), and...
Ya I considered passing the size but I was hoping I could get around it to keep the parameter list down. Oh well thanks for the info.
Ronix, I read about macros like that before but I can't tell...
My main goal is to find out the number of elements in an array. In my program I have something like this:
int arr1[] = {3,4,6,7};
printf("The array has %d elements.\n",...
I was really just looking for an example of how something like this might work. The first time I tried the previous example I got an error an thought I must have been way off base, but it magically...
char* version = (char*) glGetString(GL_VERSION);
messagebox(hWnd, version, "title bar", MB_OK );