49,755 Topics
![]() | |
Without the name, it runs fine. I read up that adding const before new could solve my problem, but it doesn't. Any ideas? include <iostream> include <string.h> using namespace std; class Player { int Health, *Strength, *Speed, *Accuracy, *Defense; char *Name[80]; public: Player (char, int, int, int, int, int); ~Player … | |
I'm in an intro C++ class and am suppose to make a phonebook program that will show a list of commands then read in a name,number ,and notes into a file. Then be able to retrieve a name, or display the whole contact list. I'm having trouble getting the find … | |
Using an appropriate definition of ListNode, design a simple linked list class with only two member functions and a default constructor: void add(double x); boolean isMember(double x); LinkedList( ); The add function adds a new node containing x to the front (head) of the list, while the isMember function tests … | |
Code blocks are created by indenting at least 4 spaces ... and can span multiple lines class Wizard : public QDialog { Q_OBJECT public: Wizard(QWidget *parent); private slots: void what_ever(); private: QPushButton *what_ever; }; Wizard::Wizard( QWidget *parent ) : QDialog(parent) { QGridLayout *layout = new QGridLayout( this ); QScopedPointer<QTextEdit> textEdit(new … | |
basically what ive got going is some transformations using my own functions, ive got them working fine still using glMultMatrix but im not allowed to use that for this. im trying to make my own matrix multiplication function and im getting stuck somewhere. the matricies are all one dimensional arrays … | |
I am studying and reviewing topics but haven't found definition that I somewhat favor, any answers for the below questions will be very helpful. * What exactly is meant by the phrase "interface for a class"? * Anyone knows any UML class diagram tutorial that they found helpful? * In … | |
I have recently started learning C++ and I'm having some trouble with the following problem: "Suppose a cuboid has three sides length, depth and height. Write a C++ program that reads from keyboard these 3 sides in the form of integers, with proper input prompt/s, then display the volume of … | |
Class extStrSet inherits from class strSet. The following function down-casts from the former to the latter. inline extStrSet& ss2extss (const strSet& ss) { return *(extStrSet*)&ss ; } Can someone explain how the down-casting is accomplished by explaining each part of the expression in the return statement? Also why is downcasting … | |
Hello, I have an assignment to convert some given jave code into c++. I am currently having an issue wherein when I run the program it tells me that: error C2660: 'approximateSqrt' : function does not take 1 arguments. Any suggestions for moving forward would be appreciated. I have the … | |
Hi ive made a code which does two things. First is read from a separate .dat file a product's model number, name a proce. The second bit allows the user to choose the product model. Depending on what the user chooses, only 1 of the products is displayed. So for … | |
Hello all, I hope this is the correct place to ask this question. I joined 5 minutes ago so first off Ill say im a absolute noob at programming- I have no idea how to program. I have tried to learn over the years but have never been able to … | |
Hi all, I am doing some c++ exercise about operator replacing. I have successfully replaced the + (plus) operator to work on a user-defined class. I understand these operators are order-sensitive: need to replace the operator for (class+int) and for (int+class). Thus, creating **two** replacements that do exactly the same. … | |
I have a modified a DLL called UserEnv and I decided to check out reverse engineering and assembly.. When my DLL Loads, it writes and displays a messagebox saying it's loaded.. Sorta like injection into notepad which I learned from: [How To Inject Into Notepad](http://home.inf.fh-rhein-sieg.de/~ikarim2s/how2injectcode/code_inject.html) The DLL Now looks like: … | |
I was just wondering is this reading a file one byte per time? int main () { FILE * pFile; int c; int n = 0; pFile=fopen ("myfile.txt","r"); if (pFile==NULL) perror ("Error opening file"); else { do { c = getc (pFile); printf("%c-",c); } while (c != EOF); fclose (pFile); … | |
i graduated from Old Dominion University in may of 2011 with a BS degree in computer science and can not find a job. not because they don t exist, but because i dont have experience, which is what they all have told me, even the entry level positions i found … | |
Hey guys, I am making a simple c++ compiler with Visual Studio 2010, but I am stuck on the converting it to assembly bit(with c++ coding). What I am trying to do is convert the code they type(in a cpp file) to assembly, then translate it to machine code etc. … | |
Give a main function written in C++. Your main function is to see if it has been passed exactly one command line argument (you are to check that there is exactly one), and it has the value –verbose The function will set the local integer variable foundVerbose to 1 if … | |
Hey Guys, I've come across a strange problem in DirectX 10 that I would really appreciate some help with: When trying to render ID3DX10Mesh objects that use a particular input layout, the vertex data seems to alter slightly before the object is passed to the vertex shader. I have been … | |
I need someone to check my bitmap class for me. I load a bitmap from a file but I cannot get it to draw to the specified window :S I'm not sure if I'm loading it right or how to get the pixel data for BOTH 32 and 24 bit … | |
So i was simply following one of the opengl tutorials - http://nehe.gamedev.net/tutorial/loading_and_moving_through_a_3d_world/22003/ So everything works completely fine except one thing, when i load in textures with SOIL lib its not completely correct, but with GLAUX lib it works just fine but i dont prefer using GLAUX. Here is what i … | |
I need some help understanding the follow functions & how they work. 1) y >> 16 & 0xFF0 2) (y >> 16 & 0xFFC) << 4 3) (y >> 20 & 0xF0F) | 1 << 7 | |
I am having a linker error in a file of some 3000 lines that I cannot seem to reproduce. I was wondering if anybody had any ideas where the problem could be. Basically I have a function in a header file and whenever I go to link my project it … | |
I am trying to create two functions both named maximum (which overload each other) that compute the maximum of two arguments. The first should find maximum of two arguments of type double. The second should accept two arguments of type string (not C-string types) and should return the argument that … | |
Hi any expert know what wrong's with this? I have 102 syntax error. I am suspecting did i miss out identify #include something like #include stdio.lib or? Please help me! thanks! I have been posting entries but none of the expert solved this. So hope you do, thanks! By the … | |
Hi I'm looking to upload files using http post using winsock and have a php script handle it. I've got it working fine for text files but with files that contain null characters such as exes it doesn't work. It is only copying the file buffer up to the null … | |
Hello, Please excuse me if this isn't the correct place to post this topic. I have a friend that knows PHP, and I know C++. We want to make a PC game together. I would handle making the core game, and he would use PHP to create a server, allow … | |
Hi ive made a program that does 3 things. 1. lets you enter 2 words to form one word ( red + cat = redcat ). 2. opens a separate txt file. 3. checks what you entered is the same as one of the words in the separate txt file. … | |
Hi just started C++, was forced to take the class I just need some help I have to, not watn to, but have to take C++ as my course we are given this homework, CAN YOU PLEASE HELP ME!?!? I will be forver gratfull!! You will develop a simple windows-based … | |
I am having some proplems with my code - I am told to create a mouse and apple game and I am having some trouble with using the array in different funtions. Here is a short version of my code - //defining the size of the grid const int SIZEY … | |
Below is a merge sort function provided by my instructor, my task is to create a program that asks the user to input numbers in random and choose which type of sorting algorithm he wants to use to be able to sort the numbers, I managed to finish quick sort … |
The End.