Type: Posts; User: Moschops
Search took 0.01 seconds.
January 26th, 2012, 08:43 AM
Which matches my comment exactly. If the code carries a guarantee that it will never be read by a human, you can do whatever you like with it. I am yet to encounter any code for which such a...
January 25th, 2012, 07:33 PM
Sounds like they're begging to be put inside a single structure named something like currentState which is then passed by reference where needed.
Space is free. The compiler charges nothing.
September 9th, 2011, 12:22 PM
Yes, there is a way to tell incorrect code; you can write the code and then use a program called a compiler on it. The compiler will tell you if the code is incorrect, and will usually give you...
April 26th, 2011, 08:08 AM
Is making a GUI a requirement? This would be much easier if you didn't make a GUI, and ran it from console.
April 22nd, 2011, 03:44 PM
I suspect that the problem is you're using degrees as your unit of angle, which is not what the cos function is intended for.
March 8th, 2011, 05:41 AM
There are many different containers to choose from; each is implemented differently, with different relative strengths. Ultimately, it's up to you to choose the best one for your purposes based on...
March 8th, 2011, 05:37 AM
The first method is not standard and will not work with all compilers; furthermore, when a pre-processor encounters a #pragma directive it does not understand, it is (usually) silently ignored, so...
March 4th, 2011, 12:10 PM
Are you getting any compiler errors? The open function of an ifstream object takes a char* and you are feeding it a std::string. If I try that, the compiler objects.
Also, double check whether or...
March 4th, 2011, 11:15 AM
As an aside to your primary question, that call to main() at the end of your function void list(vector<string>files) - what is that for? Why are you calling main from within a function?
I think we...
March 4th, 2011, 11:12 AM
Tat vaL is like rite woteva, ya now? its like wot was in dat like space wen u md yr like a
February 10th, 2011, 10:44 AM
They are not intended to be a replacement for returning values from functions.
February 6th, 2011, 04:23 PM
VC++ is a set of applications to write, compile and link C++ code.
February 4th, 2011, 07:34 PM
I haven't definitely seen a compiler bug for a decade. It would have been 2001, using the compiler that came with VS6.
February 3rd, 2011, 06:14 AM
There's always the doomsday option for including headers:
So you're saying that the...
January 24th, 2011, 07:44 AM
This pseudo-code is the sort of thing that would do the job. It should explain to you a method.
// Get length of source char array (using strlen).
// Make target char array of this size...
January 23rd, 2011, 01:02 PM
I would disagree. I suggest that his job is to teach effectively, not promote book sales. If the best way for him to teach effectively is by having the students read a book, then great. It may well...
January 21st, 2011, 07:38 PM
Loop unrolling sometimes helps.
for (int i=0; i<some_val; i++)
January 19th, 2011, 12:31 PM
Have you tried typing
dir c:\Program Files
on your windows command line? It won't work.
If you include spaces, you need to wrap it in quotes.
dir "c:\Program Files"
January 19th, 2011, 12:21 PM
How do you know the path is correct? If it cannot find the specified path, that would imply that the path must be incorrect.
January 19th, 2011, 12:14 PM
The error you listed above indicates that you have a std::String, and you're trying to feed it to something that expects a const char*. This makes sense, as...
January 19th, 2011, 12:06 PM
What do you mean by "best"? The code you have posted will work on any system that recognises the DIR command in the shell (once you solve that string to char* problem). Which, I think, is windows.
January 19th, 2011, 10:13 AM
Whilst this is true, it is not perfect; I know of occasions on at least one IDE when the IDE and the compiler actually had different opinions, so everything looked great in the IDE, but the...
January 19th, 2011, 09:50 AM
If you use the switch -E with g++, you will get out the code immediately after pre-processing, so you can see exactly what code is going to the compiler, and you'll know for sure if the header is...
January 19th, 2011, 05:58 AM
For a long time, the MS compiler that shipped with VS would happily let you do things you shouldn't with off-the-end iterators. As I recall, under the hood, iterators were being implemented to some...
January 19th, 2011, 05:33 AM
Your compilation line
g++ -g -w Test0/memoryleak.cpp -o /home/ramamj/TestObj/memoryleak.o
doesn't contain your memory.cpp file
Click Here to Expand Forum to Full Width