49,761 Topics
| |
Is it possible to ask the user to input the size of a 2-dim array? | |
Hello, Here is the problem ive been working on: write a while loop that displays each int from 1 to 5 together with its square and a cube. Display all three values for integer on a separate line. My problem is that it does not really do what it is … | |
First off, I have searched the forums and have not stumbled across the answer to my question. If I overlooked it feel free not to post here or close the thread or link me to the correct thread. I apologize if i missed it. I'm trying to create a number … | |
I am trying to read the data (integers) from a file to a larger unsorted array and then move specific elements from that array to specific sub arrays. I can write the data from the file to the unsorted array fine but I get the wrong integers when trying to … | |
error C2679: binary '>>' : no operator found which takes a right-hand operand of type 'overloaded-function' (or there is no acceptable conversion) | |
ok ive got my program to work now but cant get it to ask me if i want it to make a new calculation and i need to do this with a while command i dont what a done code out of you ppl cause its my homework and i … | |
[code=cplusplus] #include <iostream> using namespace std; int main(){ int n ,sum(1),k; cout <<"Please enter an integer n "<< endl; cin >> n >>endl; for(k=1;k<=n;k++) { sum +=(1/(1*(k+1))); } cout << "The sum = " << sum <<endl; return 0; } [/code] It does not recognize the input operator >> when … | |
why do i keep getting the same1?? [code] #include <iostream> #include <ctime> using namespace std; struct card { int value; char suit[10]; char faceCard[10]; }; int deal(card deck[maxcards], int decksize, int &z); void shuffle(card deck[], int decksize); int score =0; int main() { int scoretracker =0; card deck[52]={{11, "s", "ace"}, … | |
I am wondering if theres code for removing this software completely, but through code ? It has been a while since I have been working on this type of a project, but now that I am trying I noticed security centers such as norton, and mcafee have changed a bit … | |
I have been searching (google and books) for an answer to this question for a long time without managing to find any answer worth the name, so I'll try posting a thread hoping for better luck. Can someone explain to me why this: [code=C++] Aclass **tmp, *aclass[10]; tmp = aclass; … | |
hello my dear am sorry to give this disturbance, i need a full cup of help am thirsty. i design a database application with c++ and access, when i test on my PC it work fine but on others PC it can find settings of ODBC what can do to … | |
Hi Friends, Can any tell me a free tool which detects memory leak in C++ code. to be more specific [ UNMANAGED C++ code ]. i am using some C Structs in my MFC SDI application, When i run in debug mode , the output window shows that memory has … | |
I'm looking for a very easy to use compiler that I don't have compile or download any other stuff for and on that is a GUI app. | |
I want help in reversing a string without using another array. a string "Hello" should be printed as "olleh" Please help. | |
Hi everyone, I have a project that I have to do in C++. I have already done a very similar project in Java in another course. It's kind of amazing that the teacher that was teaching the java course got all of her materials from the C++ teacher. Anyways, my … | |
The code I have thus far is as follows: [code=cplusplus] /*-------Header (head.h)-----*/ #include <iostream> #include <cmath> #include <iomanip> #include <cstdio> #include <cstdlib> #include <ctime> using namespace std; #include "fcn.cpp" #include "Montecarlo.cpp" /*-------Main Source (prog.cpp)---*/ #include "head.h" int main (void) { Montecarlo(); system ("pause"); return 0; } /*-------Source file (Montecarlo.cpp)---*/ void … | |
the program should print 1 this one should have six spaces and then 1 22 5 spaces then 2 333 and so on 4444 sum reason when i post here it aligns left 55555 666666 though it prints... 1 22 333 4444 55555 666666 [code=cplusplus] #include <iostream> using namespace std; … | |
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. |
The End.