Type: Posts; User: adrian_h
Search took 0.02 seconds.
November 13th, 2011, 07:05 PM
What are the steps you would do if you were to tell a very dense person to do this? What information will they need to remember from one step to the next?
Writing psudocode like this is a very...
November 13th, 2011, 06:55 PM
static const int in or outside of a class declaration or const int outside of a class declaration may or may not take up memory in the binary based on several reasons which include (but may not be...
November 13th, 2011, 12:06 AM
I'd recommend Eri523's class based design, it is IMHO, cleaner OO approach. It also allows you to have a local storage space for each instance which may be useful, though I can't think of one at the...
November 4th, 2011, 05:36 PM
Do you understand how to use a debugger?
November 4th, 2011, 05:32 PM
if a==b then reassign b to a new random number. Maybe a good idea to loop on this tool
What do you mean reenter a loop? Do you mean to reiterate the loop body? Try googling for the answer: ...
November 4th, 2011, 03:06 PM
Not sure, still this is posted in the wrong forum. You are:
1. programming in C not C++.
2. talking about sockets which really is a library question, not a C++ question
3. now asking about...
November 4th, 2011, 02:59 PM
Ooops. :o Up too late last night I guess.
I saw it was supposed to be the area of a circle and misread the question. A = pi*r^2 i.e. pi*(r^2) which is pi*r*r. The area of a circle is not...
November 4th, 2011, 02:51 PM
Doh! For some reason, that slipped my mind. :o Though, I didn't know about the static_assert in C++11, good to know. :)
IIRC, older compilers didn't deal with it correctly. Just something I...
November 3rd, 2011, 11:30 PM
Yes, they are mathematically equivalent. Further, symbols are usually used for constants. If they don't already exist, you usually add them for 1. readability, 2. less chance of a typo and 3. in...
November 3rd, 2011, 11:08 PM
This is the wrong forum for this. You really should go to one that is meant for html protocol stuff.
However, just in case this is a coding issue, I have to ask, is this consistent? Can you...
November 3rd, 2011, 08:49 PM
Oh, and you would probably use boost::mpl:: or_ to check one of several types or use boost::enable_if_c with || as the intervening 'or' symbol between each boost::is_same<T, type>::value. However,...
November 3rd, 2011, 08:42 PM
Well, if it is for just one type, exclude the T typename. For multiple, that excludes some types, use template meta programming. Boost has quite a library for this. I find it a bit difficult to...
November 3rd, 2011, 06:43 PM
Hmm, have you tried a non greedy match followed by a zero length look ahead? Not sure if it'll work, but worth a try.
October 28th, 2011, 01:50 PM
Are you using an IDE (eclipse, MSVS, etc...)? I have a feeling that the cwd (current working directory) for debugging is not pointing at the same directory as where your file "open" is.
October 28th, 2011, 01:40 PM
I'm not arguing with you. That is why I said "my bad", because what I had thought had glossed over that the OP wanted two variables. :o
Also, I do understand that newbies mess up the distinction...
October 28th, 2011, 02:25 AM
Np, thanks for clearing it up though. :)
Um, yeah, that was kinda the point. The OP original question was:
So yeah, you have one object, but two classes. He didn't ask for two objects. ...
October 27th, 2011, 05:09 PM
Hmmmm, didn't understand that you had a "don't" part. :) I was thinking 2 classes, the base class having a var, the derived having access to that var. They both have access to the same var. It...
October 27th, 2011, 04:58 PM
If you are creating a bunch of 'things' with almost the same initialisation parameters, then a helper function is not out of the question. This function would then do most of the heavy lifting for...
October 27th, 2011, 04:34 PM
Nope. Visibility is not the issue here, but the dependency (explicit or implicit, hidden or visible) that they all have to the static member in that kind of design. Say that a derived (directly or...
October 26th, 2011, 12:39 AM
Not sure if you noticed, but no one is answering your question. That's because we're not here to do your homework.
If you have some questions about some aspect of your code, specifically ask. ...
October 26th, 2011, 12:28 AM
So both classes can write to this variable? If so, a mutex may need to be used to keep the data from being corrupted if the objects are running on separate threads. If one is running through a...
October 25th, 2011, 11:47 PM
Not necessarily every class. This can be manipulated using protected and private inheritance. Anyway, you don't have to like it, that wasn't the question was it? :D
References can also be used...
October 25th, 2011, 11:31 PM
Make files are usually used for large projects to manage compilation of files that have changed since the last compile. This reduces the number of files to parse thus making it faster to compile an...
October 25th, 2011, 11:23 PM
Ok, I think I can see it now. :)
October 25th, 2011, 11:16 PM
No, doesn't have to be static, though that is one way to do it. If static, it does keep problems down. It all depends on the circumstance.
As everyone is asking, WHY do you want to do it?
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!