Posts
 
Reputation
Joined
Last Seen
Ranked #4K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
100% Quality Score
Upvotes Received
3
Posts with Upvotes
3
Upvoting Members
3
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
1 Commented Post
~20.0K People Reached
Favorite Tags
c++ x 66
c x 15

40 Posted Topics

Member Avatar for ~s.o.s~

[QUOTE=invisal;653516][B]Text-based Role-Playing Game Project [COLOR="Green"](For Beginners)[/COLOR][/B] [INDENT]Firstly, this game will start with an introductatory storyline of the game to attract player interest. Then, it asks a player to enter his or her name and which class the player want to choose. There are going to be 3 classes for player: …

Member Avatar for gyno
22
7K
Member Avatar for twek

[QUOTE=twek;728917]title is self explanatory how do i convert it to a std::string? all this LP stuff makes my brain hurt...[/QUOTE] try static_cast<std::string>(the_LPWSTR_var); or if it doesn't work reinterpret_cast<std::string>(the_LPWSTR_var);

Member Avatar for easysir
0
3K
Member Avatar for varunrathi

You can do it your self if you know some math :) w o r d = 4 letters which aren't the same = 4! s h e e p = 5! / 2! (the 2 ee)

Member Avatar for richieking
0
920
Member Avatar for mark0420

Get a book. I started with [URL="http://www.amazon.com/Beginning-C-Game-Programming-Development/dp/1592002056"]Beginning C++ game programming[/URL]. It's a great book to begin with.

Member Avatar for vxp
0
283
Member Avatar for serkan sendur

[QUOTE=serkansendur;730786]is there any vay to access iterator's index value without using another variable in the for loop?[/QUOTE] [code=C++] #include <iostream> #include <vector> using namespace std; int main() { vector <int> vec; vector<int>::iterator iter; for(int i = 0; i < 5; ++i) vec.push_back(i); for(iter = vec.begin(); iter < vec.end(); ++iter) cout …

Member Avatar for guest7
0
179
Member Avatar for lotrsimp12345

You overload an operator when it makes sense to do so. Say that you create a custom string class [b]MyString[/b]. It makes sense to overload the [b]+[/b] operator, but not the ~.

Member Avatar for lotrsimp12345
0
182
Member Avatar for CPPRULZ

shoe_copy=shoe1; will call the assignment operator, not the copy constructor. The copy constructor is called for example when you pass an object to a function by value. // copy constructor called (notice I pass by value, not by reference) void f(Shoe s) { }

Member Avatar for MMahmoud
0
148
Member Avatar for jraven1

You can do that: [code="C++"] bool checkUnsignedInt(const string &str) { return atoi(str.c_str()) >= 0; } [/code]

Member Avatar for ArkM
0
274
Member Avatar for titosd

You can't return two values from a functio using the return statement. Use a struct as you've been told to above: [code="C"] typedef struct { int x, y; } P; P getPoint() { int a, b; //a = .... b = ..... P temp; temp.x = a; temp.y = b; …

Member Avatar for death_oclock
0
168
Member Avatar for minas1

Well my main() function has become a mess... What should I do next time to prevent this? [code="C++"] int main(int argc, char *args[]) { srand((unsigned)time(0)); if(!init()) return 1; atexit(cleanup); // to cleanup the surfaces // load images background = loadImage("background.jpg"); message = loadImage("play_again.jpg"); youWinMessage = loadImage("you_win.jpg"); youLoseMessage = loadImage("you_lose.jpg"); start: …

Member Avatar for Comatose
0
209
Member Avatar for Phil++

[QUOTE]What I am trying to do is change the cin >> varible; into something different so when I find it easier when I code.[/QUOTE] Why do this? Is [b]cin[/b] hard to remember? You need to get used it, you'll see it everywhere!! Think of it as "[b]c[/b]onsole [b]in[/b]put", this might …

Member Avatar for minas1
0
118
Member Avatar for vandenzergen
Member Avatar for minas1

[code=C++] #ifndef DARK_OBJECT_H #define DARK_OBJECT_H #include "DarkGDK.h" namespace DarkObject { class Object // abstract { public: Object(); virtual void x() = 0; protected: int imageID, spriteID; }; class Rect2D { public: Rect2D(int x, int y, int width, int height): x(x), y(y), width(width), height(height) {}; int GetX() const {return x;} int …

Member Avatar for minas1
0
86
Member Avatar for watersnow14

Read this: [url]http://www.daniweb.com/forums/announcement8-3.html[/url]

Member Avatar for AmyH2008
0
289
Member Avatar for riahc3

[code=C]#include <stdlib.h> /* needed for rand() function */ #include <time.h> /*needed to call srand() (explained below)*/ int main(void) { int r = 0; /* by calling this function, we seed the random number generator. If we don't seed it, we will get the same numbers every time we generate random …

Member Avatar for Narue
0
222
Member Avatar for g_loughnan

[code=C++] void increment(const Machine &aMachine, int amount = 1) { rackID = rackID - amount; } [/code] [B]1.[/B] You are passing aMachine as [B]constant[/B] reference and you are trying to change a member of aMachine. This is illegal, since it's constant. You could pass a reference: Machine &aMachine [B]2.[/B] void …

Member Avatar for StuXYZ
0
620
Member Avatar for ALAZHARY

[B]result[/B] is a local variable, which is destroyed when the functions ends. So a garbage value is destroyed. The best solution is to do what is said by the poster above. If you need to work with pointers you can do this: [code=C++] double* treble(double data) { double result = …

Member Avatar for ALAZHARY
0
654
Member Avatar for minas1

Hi, I'm studying operator overloading through [B]C++ the complete referece[/B] and I've got some questions. In the book, the author writes this: [code=C++] loc loc::operator++() { ++longitude; ++latitute; return *this; } [/code] This creates a new object and returns it. [B]1.[/B]Wouldn't it be more efficient to return a reference? [B]2.[/B]This …

Member Avatar for minas1
0
163
Member Avatar for Tank50

There are a couple of tutorials [URL="http://www.cprogramming.com/tutorial.html"]here[/URL].

Member Avatar for William Hemsworth
0
145
Member Avatar for dapcigar

Just a bit of advice. No one is going to download all these files. You should provide the code with the errors and try to explain. Help us to help you.

Member Avatar for minas1
0
86
Member Avatar for bf2loser

Try adding header guards in header.h [code=C++] #ifndef HEADER_H #define HEADER_H #include <iostream> // put your includes in the header file so you don't need to include them in every file that uses this header #include <...> class blah_blah { }; ... #endif [/code]

Member Avatar for bf2loser
0
207
Member Avatar for minas1

[code=C++] int MAX_NUM = 600851475143; int max = 0; vector <int> ints; for(int i = 1; i <= MAX_NUM; ++i) if((int)MAX_NUM % i == 0) ints.push_back(i); cout << "size = " << ints.size(); [/code] I get 0. Something is wrong. I get 2 warnings: warning C4305: 'initializing' : truncation from …

Member Avatar for Alex Edwards
0
126
Member Avatar for dblbac
Member Avatar for elsa87

Show some effort first and then people will help you. Don't expect others to do [B]your[/B] work. Just an idea: The class could contain a [B]static pointer[/B] that would point to the last element. You could set it in the constructor.

Member Avatar for Narue
0
143
Member Avatar for davids2004

[code=C++] int input; const int ANSWER = random_integer1 + random_integer2; do { cin >> input; // get input } while(input != ANSWER); /* this will repeat as long as input is not equal to the answer. when the correct value is entered, the loop won't run */ cout << "Well …

Member Avatar for davids2004
0
402
Member Avatar for number87

You can have functions in Cargo that return the details and don't change any value. [code=C++] class Cargo { public: int get_weight() const {return weight;} // the const here means that this function cannot change anything from the class int get_height() const {return height;} int get_width() const {return width;} /* …

Member Avatar for minas1
0
122
Member Avatar for insertnamehere8

[QUOTE=Ancient Dragon;737748]when using character arrays the == operator does not compare string content but string addresses, so it will never work. You need to call strcmp() which returns 0 if the two strings are exactly the same.[icode]if( strcmp(name[i], "Jack Danial" == 0) [/icode] . strcmp() is case sensitive, meaning "Jack" …

Member Avatar for insertnamehere8
0
225
Member Avatar for minas1

Hi. I made some headers I want to include in every project from the include directories. So I'll be able to do [I]#include <hello.h>[/I] instead of [I]"hello.h"[/I], and I won't need to place them in the same directory every time. So I did this: [IMG]http://i38.tinypic.com/2n1bdj8.jpg[/IMG] [IMG]http://i34.tinypic.com/33a4d1g.jpg[/IMG] but it doesn't work. …

Member Avatar for cikara21
0
235
Member Avatar for minas1

Hi. I'm trying to overload +=, -= and *=. [code=C++] /*error C2297: '+=' : illegal, right operand has type 'Matrix *' error C2114: '+=' : pointer on left; needs integral value on right*/ Matrix* Matrix::operator +=(const Matrix *const m) { if(x == m->x && y == m->y) myArray::Add(ppMyArray, m->ppMyArray); return …

Member Avatar for ArkM
0
153
Member Avatar for minas1

[code=C++"] int x[5]; x[4] = 10; *(x + 4) = 10; [/code] Array indexing has a cleaner syntax but (as I've read) pointer arithmetic is faster. My question is, is it worth to use pointer arithmetic? Is there a noticeable difference?

Member Avatar for ArkM
0
1K

The End.