107 Posted Topics

Member Avatar for DaniwebOS

Rather than DayOfTheWeek.getDay, use getDay() Since you are calling a method of the class from withing the class

Member Avatar for template<>
0
287
Member Avatar for CanaznFTW

In times of need, Google is your friend!!! [url]http://stackoverflow.com/questions/190229/where-is-the-itoa-function-in-linux[/url]

Member Avatar for CanaznFTW
0
405
Member Avatar for user543820

[CODE] #include <iostream> #include <string> #include <sstream> int main() { std::stringstream expression(" 3 + 4 ( 5 * 8 "); std::string token; const char DELIMITER(' '); while (std::getline(expression, token, DELIMITER)) { std::cout << token << std::endl; } } [/CODE]

Member Avatar for Ancient Dragon
0
173
Member Avatar for thisischris

You might want to consider to first break the problem into set of points (x,y). Then extract and convert each set of points to numbers.

Member Avatar for thisischris
0
215
Member Avatar for axeves

It would be good practice to always check your return codes. If you do so, you will most likely find your error.

Member Avatar for template<>
0
137
Member Avatar for Kelikmalok
Member Avatar for arkoenig
0
152
Member Avatar for honeythigh

1. Ofcourse newbies can learn C++!!! 2. Not a game programmer, but I suspect lots of games use c++ since performance is important 3. I use a mac at home, linux/windows at work. You already have everything you need. a. open a terminal window on your mac b. type nano …

Member Avatar for honeythigh
0
408
Member Avatar for bkoper16

Interesing syntax, I thought array initialization has to be a constant??? Is'nt that going to go out of range and cause all kinds of interesing problems? since i is incremented further down... int i = 0; int sales[i];

Member Avatar for template<>
0
210
Member Avatar for gl7

Below is a example of one way to remove an item from a vector using an iterator. [CODE] class Eraser { public: Eraser() { _vector.push_back("fred"); _vector.push_back("alice"); _vector.push_back("billy"); } bool remove(const std::string &who_) { for( TVec::iterator i=_vector.begin(); i!=_vector.end(); ++i ) { if( *i == who_ ) { std::cout << who_ << …

Member Avatar for gl7
0
153
Member Avatar for akase2010

You are on the right track, below is sample of array using index and pointer. [CODE] #include <iostream> int main( int argc, char *argv[]) { const size_t LIMIT = 8; int buffer[LIMIT] ={0}; // array access using index notationn for(size_t i=0; i < LIMIT; i++) { buffer[i] = i; } …

Member Avatar for template<>
-2
125
Member Avatar for lochnessmonster

According to 2003 C++ Specification this is legal. An array with no elements is created.

Member Avatar for template<>
0
88
Member Avatar for InLondon76

A problem unique to multi-core is that each core has its own cache and caches between cores must be synchronized if different threads are accessing the same variable. So you may get into a situation where a shared resource has different values in the different cache, i.e. the caches did …

Member Avatar for template<>
0
322
Member Avatar for valkyrie

Do you know how to use classes yet? It would be cleaner to model your problem using classes.

Member Avatar for template<>
0
199
Member Avatar for c+-

Are you trying to define the implementation outside the class like below? [code] class SomeClass { public: void doSomething(); }; void SomeClass::doSomething() { } [/code]

Member Avatar for template<>
0
511
Member Avatar for SolidSora

Access first letter using index 0 not 1, but make sure user entered a middle name by checking size() [code] int main( int argc, char *argv[]) { std::string middle; std::cout<<"Enter your middle name: "; std::getline(std::cin,middle); if( middle.size() ) { std::cout << "middle initial is=[" << middle[0] << "]" << std::endl; …

Member Avatar for template<>
0
115
Member Avatar for geekme
Member Avatar for template<>
0
62
Member Avatar for Taibah

Learn to think and model your problem in terms of objects and object interactions. The c++ language constructs lets you model your ideas into code. Search Google for "c++ object class design" for more information.

Member Avatar for template<>
0
490