49,761 Topics
| |
I'm writing a program wich is using an array -> startpoint[4] this array will be later filled by values from an other array. this is not the problem! the problem begins here: I have a class: computerPlayer.cpp with a method: getStartpoint() [code=cpp] int *startPoint[4]; // global variable int* computerPlayer::getStartpoint(){ int … | |
Hello, I need to test an array of chars to see if they are numbers. I am trying isdigit() but that is not working. Does anyone know how I can do this? Here is the code, it is in three seperate files. I try to test the char in the … | |
I'm trying to make my first base class header file and an inherited class from it. I've compared the syntax with at least two other examples that we did in class and they match, yet I'm getting a lot of errors when I try to compile. This is the code … | |
I am currently doing classes, but I am unable to print out my cout statements in the "elmo.modifyALL" function. I can get the other stuff to print correctly so far. This is my first time doing this kind of program, so I do not understand why I can't get cout … | |
I have an assignment and I'm stuck. The program is supposed to read in names and test scores from a data file, compute the average, and display the letter grade. This is the code that the teacher gave us in class: [CODE=cplusplus] #include <iostream> #include <cstring> #include <iomanip> // // … | |
I'm having trouble with a program with class. When it runs, on the screen and on the file it shows one output, the last one in the input file. It USED to work, untill I tried to get fancy and add some other code... that will be below the main … | |
All this function is supposed to do is count each node in the queue and return the number of nodes. [code=c++] template<class SomeType> int TemplateQ<SomeType>::Size() const { int numberOfChars = 0; QueueNode<SomeType>* countPtr; if(IsEmpty) return 0; while(countPtr != rearPtr) { countPtr = frontPtr->data; numberOfChars ++; } } [/code] I am … | |
Hi, I am trying to finish this small project of mine but I can't seem to solve the problem for a few days already. Its about an simple application on messaging and reading message between 2 phones but when I am doing it it doesn't seems to be too simple.:p … | |
Hi, i need to compile 1 DLL, i start a new project, MFC appWizard(DLL),i select regular dll and push finish. i want to compile this: [code=cplusplus] /********************************************************************* ** XTrap Bypass ** ********************************************************************** ** Hacking Detected ** ** ---------------- ** ** 00435FA6 EB 35 All referenced text string, 'Hacking detected' ** … | |
The following program is a game in which there is a pile of coins. When the loop runs two players take turns removing coins. Whoever gets the last coin wins the game. ... How can I get the looping to stop when there is a winner?? Right now it still … | |
Hello everyone, i am new in this forum and also in C++ programming. I just started learning C++ few months ago from my university then i stuck from some assignment they give me yesterday. I need to count number's occurrences from input data. This is the assignment : Enter 20 … | |
i cant get access to a pc atm im on my psp.. for(i = 0; i < 11; i++) { triangle(i, '×'); cout << triangle < endl; } triangle is a string. ty | |
i wrote this up but seem to have done something wrong and honestly i cant seem to find it, it compiles just fine, but when i run i get stuck in an infinite loop. my WHILE doesnt seem to be working, i know its to do with the variable STAMINA … | |
Hello Is it possible to Create a new character in C++? and then can we use it in in other softwars like word and such programs that you can write something in them? thanks a lot. | |
Hi all. I am trying to overload the operator+ for a SLinkedList class I created. I would like to write [ICODE]list1 = list1 + list2;[/ICODE] and obtaining that list2 is merged into list1. I thought it was simple but it didn't worked properly. I tried to simplify the problem as … | |
[CODE]#include <math.h> #include <iostream> using namespace std; void instruction(); int calculator (char); void divide_by_zero (); float do_next_op (char, float, float); int main() { //input char input; float accum,num; // instructions (); void intruction(); accum = 0 ; do { //get input cout<< " : " ; cin >> input; cin … | |
I've been trying to work it out for more than 10 hours already and still can get pass this The basic skeleton is like this [code] class BST { public: .... void insert (const device & aDevice); ..... private: ..... }; class device : public BST { ..... }; [/code] … | |
How can i grep a file using c++..? I have a file. File having a keyword. i want to get the count of that. i am tring to do int count ; count = system("grep -c keyword file1.txt"); cout << count ; /// this is giving me system command return … | |
Hi all!! I am trying to save the subkeys and values of a key in a text file and i am not getting the result. the file created has not a recognizable name and there is nothing stored in it.. so please help me in this....thanx here is the code: … | |
This program is supposed to read 10 integers from an input file, save the largest and smallest integer to an outfile, and compute the even and odd integers and save the sums to an outfile. (The contents of the file named input.dat are: 45 23 12 8 -67 56 87 … | |
how do you make a node of pointer of a device? (device is just a class that i made up, i need to use pointers in LL so i can "share" one object with multiple LLs) [code] struct node { device * devicePtr; node * left, * right, * next; … | |
I need help writing functions. In this program I need to be able to implement a number of useful functions using a header file and an implementation file. I also need to place the prototypes for my function in a .h file, and implement these functions in a .cpp file. … | |
I am storing some data in a sting & I'm retriving it using stringstream but the problem is that it repeates last element two times.I could not understand why is this happning?Is there anyone who can help me on solving this problem? Programme code is as follows::::::::::::: [code=cplusplus] #include<iostream> #include<sstream> … | |
I'm having problems in my "RemoveAt" function. I am trying to get a user to input a a position that represents a number they would like to remove from the array. Example below. For example: Current array.... 4,23,65,34,82,37,12,17,24,36,82,51 User input: [B]1[/B] (1 represents the position of what number will be … | |
Is there any open source c/c++ compilers what can be debugged easily? I wanna know more info about the common knowladge about c/c++ compilers. | |
HI I was writing a program that passes a string into an array, reverses the string, and passes to another array. Half way done with my function definition I compiled and got some errors, that I am not able to understand. Here is my code: [code] // Hw-4_Bhasin.cpp : Defines … | |
[CODE]//water # include <iostream> using namespace std; int main() { char code; int acc; float ammwater; float total; //get the data cout << " Insert acc number : "; cin >> acc; cout << " Type the code : " ; cin >> code; cout << " Ammount of water … | |
I have looked at a few tutorials that i could find online, but i still dont get exactly what they are used for and what the difference between going Blah[64] and Blah[8][8] is. Thanks | |
[code=cplusplus] #include <iostream> using namespace std; int main() { int num, greatest, least; char doAgain; do { cout << "This program lets you input a series of numbers and finds\nthe greatest and least values.\n"; cout << "Type in a value. -99 will finish the series.\n"; cin >> num; if (num … | |
I have some simple syntax questions about constructing a vector from an array. I just read Narue's "C and C++ timesaving tips and tricks" sticky. And I have come across something that I have seen elsewhere that I didn't really understand, and that is the following code assigns integers from … |
The End.