- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 3
- Posts with Upvotes
- 3
- Upvoting Members
- 3
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
Re:
Hello to all programmers out there. Considering the growing request for practice problems by the beginners, we ( Me, Joey, Niek, Aaron..) have decided to start a sticky which will host some common practice problems which would help the beginners in understanding the programming concepts in a better way. (Did … |
|
Re:
title is self explanatory how do i convert it to a std::string? all this LP stuff makes my brain hurt... |
|
Re:
Can anybody help me with permutation in c++. say if the entered string is "stop" then there must be 24 (=4*3*2*1) different words made by the letters s,t,o,p. Similarly if the entered string is "abcde" then there will be 120 (=5*4*3*2*1) different words made using the letters a,b,c,d,e. Please Help. … |
|
Re:
plz teach me how to create a role playing game using c++ or any programming language? |
|
Re:
is there any vay to access iterator's index value without using another variable in the for loop? |
|
Re:
I understand the concept but i don't know when to use and what my teacher expects when he says overload certain operators. |
|
Re:
So when two objects are declared say class shoe shoe1 and class shoe shoe_copy and then shoe1's variables are set, if the line of code: shoe_copy=shoe1; what would that be doing? After all what is the real data structure of the objects of class shoe? |
|
Re:
Hi, I'm having problems checking whether a string is an unsigned integer. The code I am using only checks the first character of the string, so "a1" would return false, but "1a" would return true. Any ideas where I'm going wrong? [code] bool checkUnsignedInt(string *str) { unsigned long value; stringstream … |
|
Re:
Hello, I have a question, How I can write a function that return 2 values. the function should take 3 numbers and do between the first and the second number an arethmetic operation and check if the result will be the third number, if yes the function return 1 and … |
|
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: … |
|
Re:
What I am trying to do is change the cin >> varible; into something different so when I find it easier when I code. The line that I am changing it to is input (varible); i am using this: #define input(i) cin >> (i); it works, however it will only … |
|
Re:
Hello everyone, I really want to know what should I do first in making games using c++. We all know that c++ is the most widely used programming language in making games. But, there is still things which are not clear to me as of now. I'm still a newbie … |
|
[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 … |
|
Re:
Hello. My first thread here @ daniweb. Im stuck on some source code. I am trying to create a small program that allows user to input '1' or '2' for class selection on an airplane. 1 for first 2 for economy. the plane capacity is 10, which is also the … |
|
Re:
Is there a good webpage that explains how to use rand() and srand() correctly? Overall I need to learn how to generate a number between 0 and 3. |
|
Re:
Hi All, I'm trying to figure out how to pass an object to a function by constant reference. If I write a single class, can I write a function in this class that accepts an object of this class by constant reference? If so (or in any case) how does … |
|
Re:
Hello, everybody. first, look at the following code: [CODE]#include <iostream> 1 using std::cout; 2 using std::endl; 3 using std::cin; 4 5 double* treble(double); 6 7 int main(void) 8 { 9 double num = 5.0; 10 double* ptr = 0; 11 ptr = treble(num); 12 cout << endl 13 << "Three … |
|
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 … |
|
Re:
Hi Guys Most of time iam interest do a programming using C# language,but I got a project for PDA,so I hope to developed it using C language,Iam new to C language and ,what steps i have to do learn C language.Starting from first i think its time wasting,so what is … |
|
Re:
I've been trying to convert my Modular programming code from array to link list.. the whole program is kinda messy now.. could anyone help me figure out what problem am having with the code? PS: am using Vc++6 to compile... Thanks in Advance |
|
Re:
I'm getting an unresolved symbols linking error with this code, the cpp files compile successfully separately, I just can't build the solution and run it. any ideas? header.h [code=c++] #include <iostream> #include <string> using std::string; using namespace std; class Double { private: double dub; char str[50]; public: Double(); Double(char s[50]); … |
|
[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 … |
|
Re:
i was given this question by my instructor and i am completely in the dark on what to do. i have been trying to figure out what to do but couldn't find anything in the book that really explained it. any help with this would be greatly appreciated. explain what … |
|
Re:
please help me write a function which will return the last element in an unsorted list. the prototype of the function should be ItemType ReturnLastItem(); we should assume that the list is not empty ans it shouldnt change after the program is executed.. pleeeeeeeeease help me |
|
Re:
I am trying to write a program that can be used to display two random numbers to be added together. This program should wait for the answer to be input. If the answer is correct display a statement that says that is correct. If the answer is wrong it needs … |
|
Re:
ok basically what my program is about. I am to create a program that allows users to input aircraft/cargo details, add the cargo to the aircraft(up to 20), and a function to display all the cargo on that aircraft. So the main problem i am getting is with the listing … |
|
Re:
Hi. This is for a phonebook assignment. Part of the assignment involves searching a 2D array. This is the function that reads the phonebook file. [code] void getData(char name[][NAMESIZE], char telephone[][PHONESIZE], char zipcode[][ZIPSIZE], char address[][ADDSIZE], int& size); ~~~~~ void getData(char name[][NAMESIZE], char telephone[][PHONESIZE], char zipcode[][ZIPSIZE], char address[][ADDSIZE], int& size){ int … |
|
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. … |
|
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 … |
|
[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? |