49,761 Topics
| |
I have two classes; primatives.h [code] class PS2Sprite { public: PS2Sprite::PS2Sprite(); PS2Sprite::PS2Sprite(const float x, const float y); PS2Sprite::~PS2Sprite(); virtual void Render(void) const; virtual void RenderPerspective(void) const; void MoveTo(const float x, const float y, const float z); void Rotate(const float angle); void Rotate(const float angle, const uint8 x, const uint8 y); … | |
What is needed for a C++ member function of a class to behave polymorphic? Please can anyone answer me to this, and if you can give me some example. Thanks. | |
hi i am trying to create a class that contains a struct. This struct inherits properties from other classes. [code] class people { public: struct person:public parent { private: char * data public: setdata(char * x) } [/code] In the parent class i have [code] class parent { private: public: … | |
hi guys, i m new to vc++ and i have a task assigned to use the lzo algorithm in my project so i downloaded its full source code of version 1.08 from the [url]http://www.oberhumer.com/opensource/lzo[/url] now when i m opening its sample.c file (which is a example file in the example … | |
Hello, I have a rather complicated pointer/syntax problem. One of my function arguments is a pointer to a structure which contains a void pointer. If I point the pointer to a scalar then in my function I can access it like this: [ICODE] local_var = (appropriate_type *) struc->pointer; [/ICODE] But … | |
class Student { private: string studentName; // Would this be initialising a student's name and program code to empty strings.?????? string studentProgramCode; public: /** * Default constructor. * Creates an empty Student object by initialising a student's name and * program code to empty strings. */ Student(); //Default constructor.??? /** … | |
{I am a newbie to this forum and programing. I am trying to write a program that takes a lists of technical support engineers and move them from the top of the list to the bottom when they get a support call assisted to them. "round robin" A little background … | |
Hello there! I'm having problem with my drawing graphics programming, let's say I want to draw a circle. This circle is made out of smaller pieces called pixels. Okay I got a pixelclass containing three values x, y and color. My circle contains a vector which contains all the pixels … | |
Greetings, I have the following class [ICODE] class test { public: test():element(NULL), previous(NULL), next(NULL){}; void *element; test *previous, *next; }; [/ICODE] this works fine: [ICODE]test * a_test[/ICODE] but this crashes: [ICODE]test a_test[/ICODE] does anybody know what it is that i am doing wrong? I am sure its something that has … | |
Hey all, Here I am again, most of my program written but I'm stuck with the last step. The assignment is asking us novice programmers to add three functions (1. to subtract, 2. to multiply, 3. add a function DollarsAndCentsAre which will print out (using cout) the complete value of … | |
I've been trying all night to get this to work, but everything i do give me a compile or runtime error. currently I'm using file_size() (no idea what to include inside the brackets). Also if you have can help with any of the following it would help me greatly: -list … | |
## Before You Ask ## - Read our [Forum Rules](http://www.daniweb.com/community/rules). - Engage your brain! We understand that running into a problem can turn off the rational centers of the brain, but please sit back and think for a bit about your problem before running off to find help. All too … | |
If I were to work on say an Instant Messenger project, and wrote the gui and event handling using wxWdigets, could I then use the windows API and use winsock to connect the two computers? Basically are API's interchangble in source code? | |
| I'm not good in C++ and I need your help. I have some small program that can automatically play chess in internet chess servers. It needs only the chess engine to play. I play only on [url]www.kurnik.org[/url], but from a few months they changed adress to [url]www.playok.com[/url]. My problem depends … |
I got this assignment and the way it is worded is confusing to me. If anyone can explain it better it would be a great help also how to approach the problem Use a one dimensional array to solve the following problem. Read in 20 numbers, each of which is … | |
I need to calculate the standard deviation for an array in my program, the array I need to calculate it for is the pgmavg and testavg everything else in my program works correctly. [code=cplusplus] /******************************************************************** CSCI 240 - Assignment 7 - Spring 2009 Progammer: Justin R. Smith Section: 9 TA: … | |
Hello, I have seen many problems that deals with big integers. I use C++ and it can handle only some digits. Can you help me on how to represent and use them? | |
Hello, I need to make this program sort the numbers entered with merge sort then print them. I am having trouble calling merge sort and getting it to print. Here is the code: [code] #include <iostream> #include "queueLinkedList.cpp" using namespace std; /*struct Item : Data { int value; Item *next; … | |
Hello, I am having trouble understanding linked lists. I have to make this program that takes input, stores it to a queue, outputs that input, then sorts it using mergesort and outputs it again. It all works except I'm not sure how to call the mergesort classes. Here is the … | |
[CODE]#include <iostream> using namespace std; bool isVowel(char character); int main() { char character; cout << "Enter a letter, if it is a vowel this program will tell you" << endl; { cin >> character; cout << isVowel(character) << endl; if(isVowel(character)==true) } bool isVowel(char ch) { if('A'==ch||'a'==ch||'E'==ch||'e'==ch||'I'==ch||'i'==ch||'O'==ch||'o'==ch||'U'==ch||'u'==ch) return true; } else … | |
Hi...ok...I want to create a menu which would have 5-6 options. Now, what I want is if the user is at the first option, if he uses the down arrow key, the cursor should move at the next option. I don't want you to write the program for me or … | |
I've got these 3 questions, I didn't work so far in C++, and this is preparation for my C++ class, These questions are a little tricky and unknown to me, I tried to find the answers in Wikipedia, but I didn't manage, if anyone can answer me, please. 1.1 Can … | |
write the definition in c++ for a class named vector2d that stores information about a two-dimensional vector. the class should have functions to get and set the x and y components, where x and y are integers next, overload the * operator so that it returns the dot product of … | |
I have my program...which displays a main menu and gives you four choices, one of which is exit. It is then supposed to move on to the next menu or the part of the program you have chosen, i.e. add temp, delete temp, list temps(this has a serperate menu of … | |
Write a program that will read in a line of text and output the number of words in the line and the number of occurrences of each letter For example I say hi Output should be 3 words 1 a 1h 2 i 1 s 1 y [code] #include <iostream> … | |
Hey everyone, long time lurker first timer poster :icon_cool: For the past week I've been trying to come up with a way of doing this but I just can't seem to think and implement anything that will work. Basicly I have a string such as "Welcome to my program" I … | |
In a part to one of our assignments we were to use an array (that represents classes) and the user needs to be able to pick..lets say..Classes[3] and get rid of it. But if the array is holding 8 spots, the program needs to be able to pick it out … | |
Hi, I've got a puzzle game program consist of 2D array 2 rows x 3 cols. The professor wants no changes to be made in puzzle.h, which is: [code=c++] #ifndef _PUZZLE_H #define _PUZZLE_H #include <iostream> #include <iomanip> #include <stdlib.h> using namespace std; // Constants const int COLS = 3; const … | |
In VS9, when i call the GetTickCount() function, it automatically converts it into the GetTickCount64() function upon compilation. This second function only works on Vista+, and thus my program errors when run on XP. I have tried adding the follow in 'targetver.h', but it did not make a difference: [code=c++]#define … | |
Expectations are this code: [CODE]#include <iostream> #include <limits> #include <stdexcept> using std::clog; namespace{ class FloatValue { public: FloatValue() : m_amount(0.0f) { clog << "Creating default floating point value.\n"; } explicit FloatValue(float amount) : m_amount(amount) { clog << "Creating floating point value with amount " << m_amount << ".\n"; if(std::numeric_limits<float>::infinity() == … |
The End.