49,761 Topics
| |
I have the following structure: CObject { protected: char *mName; public: CObject(char *n) { mName=strdup(n); } }; CVector:public CObject { char *mValues[50]; int mElements; public: CVector(char *n):CObject(n) {} }; CMatrix:public CObject { char *mValues[50][50]; int mLines; int mColumns; public: CMatrix(char *n):CObject(n) {} }; My main function: int main() { pV=new … | |
I have to write a code in which i want to use 3 dimensional array but i am reaaly confused that how 2 dimen array is indexed. 2x2 array can easily be indexed 00 01 10 11. so how a 3 dimen one can be indexed? | |
Hello, I have a chain of inherited classes like this: class A { protected: int a; public: int getA(){return a;} }; class B:public A { protected: int b; public: int getB(){return b;} }; Based on that you can see that the public can only read the values in those classes, … | |
I was trying to array a string within a string. And I keep on receiving a compiler error. So I’m wondering if is even possible to string a string within a string? Because that’s the error I keep on getting. If not then what is another way to create a … | |
I have always had this question, but I couldn't quite find anything that answered it. I was hoping someone could shed some light on the question... Thank you in advance. | |
I have an abstract class CArticle and two derived classes CBook and CMagazine. I also have a class CLibrary where i want to add articles. Its members are an int variable to count the articles and a double pointer of CArticle. I have the following main function: int main() { … | |
Hello, I was just noticing that the 'const'ness of references often causes me to rewrite a large chunk of my code with pointers. For example if I have a class that needs access to a large amount of data from another class I would love to use a reference. However … | |
Hi, I want to create a music editing program that will allow you to play songs using a MIDI device. I know there are significant differences in the capabilities of VB.NET and C++ but I'm not sure which would be more suited for such a project. Any suggestions? -James | |
in my dev c++ i'm not getting the window at the bottom of the screen which shows our errors after compilation..how do i find it..? | |
Well this is not as much as something that I dont know how to implement, but more something that I dont know why I would want to implement it. When I have a simple class, say this one: class Cube { public: Cube(int x, int y, int z); int return_area(); … | |
I've googled for a while and found few things (I hate using external libs such as cURL) and I don't really have experience with HTTP, so the question is: how can I interact with websites using sockets? so something like this: 1. I connect to the website 2. I store … | |
Greetings, this is my first time posting here, I've been a long time lurker. I have a lab assignment which is: > Write an application where you ask the user to input the price per letter (PPL), and then ask the user to input the sentence they want printed. The … | |
Anyone know how to simulate holding down a CTRL key in C++. I'm using Windows XP. Thanks | |
Hi all! I'm at work - newly hired:) - and I'm given this mpeg2 video codec [URL="http://www.mpeg.org/MPEG/video/mssg-free-mpeg-software.html"]http://www.mpeg.org/MPEG/video/mssg-free-mpeg-software.html[/URL] and in particular the decoder that exists in the folder mpeg2v12.zip. It is code c written for gcc, so I decided to download MinGW and DevC/C++. I add all the files to the … | |
i need help in this program. The program question is: A function power which will calculate a number m to the power n (m^n). You will pass two parameters float & int. If the parameter n is omitted then it should taken as 2. i hope u all got the … | |
How to make a pointer to class and how to use it? Like, what would the cout statements show on screen? #include <iostream.h> void main() { class CLASS { public: int INT; char CHAR; }; CLASS OBJECT; OBJECT.INT = 10; OBJECT.CHAR = 'A'; CLASS *POINTER = &OBJECT; cout << POINTER … | |
I am trying to write a simple text file translator, will translate the text into morsecode. I need something like this to be done: for(i = 0; i < list.size(); i++) { if(list[i] == character_from_file) { translatedLine = list[i_the_second]; } } I am wondering if I can use the "list" … | |
| |
hey there, i need help solvings my lab assignment in chapter 5: control structure II (repetition) 1. write a program that: a. prompt the user to enter an integer number x greater than 1. b. use a flag-controlled while loop to check whether the entered number x is prime or … | |
Hi there, I have a question related to C++ functions. If a boolean return type function contains too many returns in it, does it cause any problem ?? In my program one of the bool function contains too many return statements, in if conditions. And interesting thing is that it … | |
Hi My name is C.D., I am currently taking C++ 1, I have an assignment that asks me to write a function that displays the prompt string and then reads a floating point number and then returns that number. The book gives an example of the code to use in … | |
while (!correct) { cout << "Please enter an angle value => "; cin >> value; //request user to input a value if(cin.fail()) { cin.clear(); while(cin.get() != '\n'); textcolor(WHITE); cout << "Please enter a valid value. "<< endl; correct = false; } else { cin.ignore(); correct =true; } } Hi, this … | |
Illegal else without matching if, but I have an if after else. :( And how can I round off the results? I mean, if it shows 4.5 it would display 5 and if it's 4.5 it would display 4? Please help me. :((( | |
I want to open any website using me c++ program. But don't know ho it will be done, please help me. | |
Hello, First of all some background. My friend and I are having a bit of a competition over theoretically infinite number storage. We have agreed that the first person with a working arbitrary precision integer library with the theoretical ability to store an infinitely large number (IE: if the hard … | |
Hey i try to work on custom signal but i get an compiling error: QObject::connect: No such signal QLabel::changerSignal() in ..\textbasedrpg\FenPrincipale.cpp:173 But i seem to write exactly same thing in header and .cpp »That an big moment i try to see what i do incorrect but can't find. Same an … | |
These are two simple programs. In first program, i used static array, while in second program i used dynamic array. Both programs do the same job i.e. initiaze the array by asking the user to enter the their test scores. The problem is: 1)i have read in many books that … | |
I wrote a simple c++ program which takes a password and then shows a message for the intended person. Now i want to crack this program with another c++ program by using password cracker. How to use another c++ program to brute force this program? | |
[Click Here](http://s1146.photobucket.com/user/HTHVampire/media/C%20plus%20plus/Capture2_zps4d967f99.jpg.html) Here's the formula to compute sinx and cosx in C++. here is the code I wrote at first to calculate it: http://codepad.org/cbdGB8wL and it gives me good results. The problem is my lecturer would prefer me to use the formula as attached , but I get stucked, how … |
The End.