49,757 Topics
| |
Hey, Yet again i was just mucking around on DEV-C++ and made this code.. [code=c++]#include <conio.h> #include <iostream> using namespace std; unsigned long Double(unsigned long doubleMe) { return (2 * doubleMe); } int main() { unsigned long numberToDouble; unsigned long doubledNumber; cout << "Enter a number you would like to … | |
Hello all, I have a CMUCAM 2 camera. I communicate with this camera through the serial port. The camera sends the data in non visible ascii format... My question what type of format should i use in scanf command. or is there any other way to read such format? Thank … | |
How does one declare a string as a data member in a class? I tried it this way, but my compiler says that's not it [code] class cdrom { public: cdrom(); void loadinfo(); float returncost(); void displayinfo(); void changedata (); private: float cost; string name; string cdtype; }; [/code] | |
Hi all, I'm beginner in c++ programming and I'm reading a book on c++ but I just can't understand what means a term "identifier" ? | |
anyone know code so that i have to insert a username into the program before i can continue doing anything else? | |
Hello all, I have an assignment to create a base class for a vector. Now after reading through the instructions I am still unclear the instructions. I am NOT asking for you to do my homework! I just need some clarification. PLEASE DO NOT POST ANY CODE! Here is a … | |
I am getting this error and i don't know what it means. this is my code, i do have header files but i didn't include them. [code]int main() { [LIST=1] [*] cout<<"Welcome to guitar hero"<<endl; [*] cout<<"Try and press the correct letters on the line"<<endl; [*] cout<<"You will use the … | |
I have written the following code that I will post below. Each time I try to compile it I receive the following error. [CODE]1>main.obj : error LNK2001: unresolved external symbol "public: __thiscall OrderSet::OrderSet(void)" (??0OrderSet@@QAE@XZ) 1>C:\Users\Bill\Desktop\School1\c++\c++ spring cs2\program2\Debug\program2.exe : fatal error LNK1120: 1 unresolved externals[/CODE] Note I am using Visual Studios … | |
I am working on this program and I am getting compilig error here is the code:- [CODE]#ifndef ACCOUNT_H #define ACCOUNT_H class Account { public: Account(double = 0.0); void credit( double); bool debit (double); void setBalance(double); double getBalance(); private: double balance; }; #endif[/CODE] [CODE]# include <iostream> using std::cout; using namespace std; … | |
I had got an assignment for sorting some data.. "Make a c++ program which takes data from a TEXT FILE, then sort it".. i made this program.. [code=cplusplus] #include <iostream.h> #include <conio.h> int main () { clrscr(); int sort[8]; cout<<"Enter DATA to be Sorted\n"; for(int get=0;get<=7;get++) cin>>sort[get]; //cin saves the … | |
Hey, Was bored so *TRIED* to make this simple countdown program but i'm just not sure what to put in the for loop? [CODE=C++]#include <iostream> #include <windows.h> using namespace std; int main() { int countDown; cout << "Enter a number to count down from : "; cin >> countDown; for(int … | |
[code=cplusplus] struct wheel_node { int contents; wheel_node* next; }; typedef wheel_node* wheel_ptr; class wheel { private: wheel_ptr arrow; public: wheel (); void print (); void spin (int distance); void move_to (int number); }; [/code] The constructor wheel creates a circular linked list as follows: arrow -> 5 -> 40 -> … | |
I am currently attempting to program my first game in C++ using Microsoft Visual Studios Express 2005. After doing some research, I found that it is missing several packages including the one that I need (windows.h). That's free software for ya. Anyways, I was having trouble finding a way to … | |
Hey, I was using some code to write int's defined by user to a file but found when you use [CODE=C++]myfile.open ("lover_names.txt"); myfile << firstLover << " " << secondLover << " " << lovePercent << "%\n\n"; myfile.close();[/CODE] It replaces the other text in the text file, the answer will … | |
Hi I`ve just started working with graphic in c++.I want to display a stack on the console . I taugth draw a rectangle as a stack.but the problem is I don know how to draw a rectangle! I write some codes but my compiler (Dev-c++) couldn support them. I found … | |
Its an assignment I have to submit, we have to make a maze using stack and input text file but I admit that i'm tottaly lost in this, something wrong with my code (or really alot of mistakes) please help! #include <iostream> #include <fstream> using namespace std; struct node { … | |
Does anyone know if rs-232 c++ code written with the windows.h library is easily changed to support rs-485 and rs-422 or if its not similar at all? Thanks. | |
Hi, could you explain how can I do the next ? A Member function named isVolumeBigger that takes as parameter a Box(Box class) object named another and returns bool value. The function compares the volume of the object with the volume of another and returns true if its volume is … | |
Hi All, Radio Frequency Identification (RDFI) is a generic term for technologies that use radio waves automatically identify or locate people or objects. Incase you have any asset ideas or white papers on RFID technology please forward those to me. Thank you | |
When trying to compile my code with g++ i get this: MayaFunctions.h:5:27: error: calling fdopen: Bad file descriptor in that line, I simply have #include "AnotherFile.h" Google told me this has something to do with precompiled headers, but I can't figure out how to turn them off. 1) how to … | |
[CODE]#include <iostream> #include <fstream> #include <string> using namespace std; int main() { ifstream fin; string firstName; string lastName; int horseNumber; int betAmount; fin.open("jockey.txt"); if (!fin.good()) { cerr << "File not found\n"; return 1; } for (int i=0; i<10; i++) { fin >> firstName >> lastName >> horseNumber >> betAmount; cout … | |
Hello, I am new in c++. Can somebody send me code for class ellipse. I am looking urgently for code. Regards, | |
Hi everyone! I have an interesting problem in borland c++. I have to write a DLL, which contains one function. The function's aim is to create a window with a progress bar, and a close button disabled. Then it downloads a microcontroller firmware via serial port to a device. After … | |
Okay I'm gonna be honest with you... I have no idea what I'm doing... no not even a little. I'm in an online C++ class that I'm only taking because it was the last required course for me to graduate this semester... This is the last assignment due and I … | |
If I have a 2D vector like this that has 5000 elements declared. If I have filled 2500 of these elements with Numbers, what is the best way if I want to "emty" these elements so these elements will turn to 0 wich I beleive is the defaultvalue for all … | |
Hi , I am new to c++. I am reading "C++ How to Program" .In one example author divided the program into 3 files. The first one is Gradebook.h which contains prototypes. second Gradebook.cpp which contains actual implementations of member functions of Gradebook.h. last file is fig03-14.cpp which contains objects … | |
I've searched Google and have not found a solution to my problem. Function is to take a parameter and do a calculation on it. Based on the initial conditions it is supposed to return true and the the value calculated via a reference parameter. Basic code before all modification to … | |
Hello All, Can I use cin.getline(x,y) to read a line from a file? What is the form of cin.getline(x,y) when used with files? What I need to do is to output what I have written to a file to the console. I have the file open, using ofstream, and I … | |
Hey. Right now in my game (online) I'm using std::vectors to store player info. Should I continue to use them (I hate having to loop thru them each time to find a player) or should I use MySQL to hold player information (like map their on, nickname, id, position, etc.)? |
The End.