48,986 Topics
| |
Hi, I would like to know is it possible to use c++ code to control pc hardware? | |
I am having a little bit of a dilemma. I have an input file that can have a number 1 through 9 or a asterisk. I am treating 1-9 as a character. I don't know if there is white space or new lines. I can't use >> because I don't … | |
Hi mates I m new to C++ and I am trying to understand some code. ->Could one of u please explain me the three following lines of code: [code=c++] std::map<Pos3D,Object3D> Found3Dobjects; std::map<Pos3D,Object3D>::iterator Found3Dobjects_iter; typedef std::map<Pos3D,Object3D>::value_type Found3Dobjects_Pair; [/code] I read some tutorial for maps and got the idea. What I completely … | |
Hello, This is my program here...I want to make it read from a textfile and displayed in this way Number : 1 Roman Numeral : I Number : 2 Roman Numeral : II My textfile is in this form: 1 2 but i still unable to solve it...is something to … | |
Hi , I have a stl list which stores my base class pointer .Like [CODE]list<BaseClass*> eBList;[/CODE] now i want to iterate through this list and store it in one local variable. how do i do this. i have shown below the code i tried .... But at one part it … | |
I'm probably just confusing myself, but what the basic idea is I put in a grade and it outputs if the grade is an f, c, d ... etc. It allows me to enter a number and after I enter it it will continue to show F! repetitively. After this … | |
How to add keyboard shortcuts to Menu in an SDI application? Some of the things that i have tried is : say Context menu has a sub menu called Menu1 , i have mentioned it as &Menu1 which makes Ctrl + M as keyboard short cut for it [ but … | |
Hello everyone I am trying to do this assignment in the book: Write a program that reads four words (as character strings) and display them in increasing and decreasing alphabetical sequence. I have done the 1st (easy) part but not sure how to go about displaying words in alphabetical order. … | |
[CODE]#include <iostream> #include <fstream> #include <string> #include <iomanip> using namespace std; int main () { ifstream fin("program4.txt"); ofstream fout("output4.txt"); string lastName; string firstName; string fournumbers; if(fin.fail()) { cerr << "Unable to open input file\n"; exit(2); } if(fout.fail()) { cerr << "Unable to open output file\n"; exit(3); } while (fin >> … | |
To pass an ifstream type as an argument for a function? [code]bool initGame(Game &game, int argc, char *argv[]){ ifstream board(argv[1]); // <------------------- This part ifstream deck(argv[2]); int numPlayers= atoi(argv[3]); int numRounds= atoi(argv[4]); if (board.fail() || deck.fail() || numPlayers==0 || MAXPLAYERS < numPlayers || numRounds < 1 || numRounds > 1000 … | |
7. Given the class definition [code=cplusplus] class A { public: //constructors // other members private: int x; int y; }; [/code] Give declarations of operator functions for each of the following ways to overload operator+ you must state where the declaration goes, whether within the class in the public or … | |
so ive created a function that replaces all user input characters in a string with another specific user input character..the next task is to create a func that replaces a particular part of the string with a substring and ive got something down but i cant really test it becuz … | |
How is it possible to get a menu where you rightclick on the Form ? I am not sure if this is the contextmenu. I tried to add this to the Form and also some components to it but that did however not work. | |
hey everyone. i'm fairly new to programming and right now i'm taking a clss where i have no idea what is going on but anyway if someone can help me write a small simple code for a small simple program where i hav to use transducer i can paypal you. … | |
If I have a bunch of structures defined within a class header file but outside the scope of the class how would I set a SETTER function to change the values. [code] struct VoltageValues { float Vcc; int TblkLoopEnb; double Blah; }; class TblkArray { public: TblkArray(); ~TblkArray(); struct VoltageValues … | |
Hi, I am new to C++ and trying to write a function that returns a pointer to a structure. I have a header file as follows. [code=cplusplus] class Blah { public: struct Values *getValues(); struct Values { int A; int B double C; } } My class file is as … | |
I wrote the following program with the instructions in the top comments: ( I am using visual studio on vista) [code=cplusplus] #include <iostream> using namespace std; int main() { int num1, num2; int total = 0; cout << "Please enter an integer between 0 and 100: "; cin >> num1; … | |
Hi, I'm doing a program that has a class called Liga. That class has a vector with 'Equipa's. Liga has a vector called 'pessoas' which I want to access inside a function in each Equipa, is this possible? for example: Liga.h [CODE]... vector<Pessoa*> pessoas; ...[/CODE] Equipa.cpp [CODE]... void Equipa::mostraStaff() { … | |
If in a class method I pass in a list: std::list< regmatch_t* >& pm_list; and dynamically allocate memory for an array (of type regmatch_t) which is then added to the list as a pointer: regmatch_t* pm = new regmatch_t[ num_subexpressions ]; pm_list.push_back( pm ); will the list destructor automatically deallocate … | |
I have to take the following code and make it tail recursive. I am not looking for the answer, but how to find the answer. How to work through this to understand what I need to do. Our hint is that we can change the parmeters of the function, like … | |
FIXED - I'm getting a parse error somewhere in this section of code before the else and I can't see it. Please help someone. [B]NEED HELP HERE -[/B] Okay, I'm apparently getting a parse error somewhere in this code. Any help? All the errors are listed as "Parse error before … | |
Hey, it's me again. This time with a thing that has been bugging me for months and i still haven't gotten around to solving it. I need to install a font without rebooting the computer. Sounds simple but i have to do it in code or with a batch file, … | |
Is there a way to #define something as a #warning? I tried using the following code, but it gives me an error: 'warning' undeclared (first use this function) This is the part of code where the error appears: [code=c++] #define something #warning This is not a standard function! int main(void) … | |
Hello i have a project to write a program that takes 2 binomials from a text file then factor them and output it into another text file. I'm curious on how to begin going about this do i take the 2 binomials such as (x+5)(x+9) and put them in a … | |
I am using getfilepathname() to get the path of a particular file. but it returns the path of the project. i am using findfirstfile() and findnextfile() to get the handles, but still it doesnot show the directory in which handle is present... can any one help me on this issue … | |
I have the whole code written for what I want to do, but the only problem is, on my Daily_Average function, I want to print the average of the scores occurring Day 3, but I'm getting average of ALL scores together as one. Here is an example of the scores … | |
this is my program i am getting a error while compiling it can someone help me... error is ----- Build started: Project: paddy, Configuration: Debug Win32 ------ Compiling... manager.cpp c:\documents and settings\others\my documents\visual studio 2005\projects\paddy\paddy\manager.cpp(51) : error C2664: 'Pensioner::Pensioner(char *,char *,char *,long,char *)' : cannot convert parameter 1 from 'std::string' … | |
I need to extract complete path for a file givne the file name. I am using the function GetFullPathName() but it only appends the current directory of the project with the file name.. Is there any modification or some other function which can help? I am using visual studio 2005 … | |
hi, my problem is about socket programming. My code below only connects the client to the server, and it works just fine. However, I should create a 2player game which of course require the interaction of the 1st and 2nd player. The problem here is that they really don't interact … |
The End.