49,761 Topics
| |
Hi - I've can see there is other people playing around with vectors and structures in the forum - hopefully someone knows how to do this. I have a vector of structs, and I want to sort it by 'Title' (Alphabetically) - Is it even possible to sort a vector … | |
I have a richTextBox where I am trying to replace all strings that look like this: "stringvec[11][12]". I have this for loop so far that would work if the string always had the same lentgh but the thing is that I will not know if the string also can look … | |
[code=c++] #include <iostream> using namespace std; class client { private: int choice; int age; int height; int weight; char *name; public: void menu(); void setStats(); void task(); }; //======================================================== void client::menu() { cout<< "MENU \n"; cout<< "1. enter data \n"; cout<< "2. view data \n"; cout<< "3. quit \n"; int … | |
im just starting with If, else, true statements and im stuck. # include <iostream> # include <cmath> # include <iomanip> using namespace std; int main() { int score, days; bool Y = true; cout <<"Enter an assignment score and type 'Y' if it was late: "; cin >> score >> … | |
i have a small problem in my ass and i dont know how to solve it the problem is: [B]This problem is a game where n objects are arranged in a circle and every mth object is deleted until 1 object is left. The original problem is said to derive … | |
Weve been given this example to work with and Im not sure about the line 9 [B][I]char cont = 'n';[/I][/B] - is there even a need for it? The rest of the program I understand. [code=c++] #include <iostream> #include <stdio.h> using namespace std; int main() { int no = 1; … | |
We're supposed to write a function that calculates both the x and y coordinates of the upper left corner of the square that just contains a circle, given the x and y coordinates of the center of the circle, and the radius of the circle. Return the x and y … | |
I have to write a program that finds the center of gravity. | |
I am creating a program to manipulate structures that are similar to linked lists. The problem i am having is in a text file that i am reading in there are delete lines like this. d 1 2 d 2 3 d 3 4 d 2 0 with the first … | |
Can one of you gurus give me some help please. I am a new programmer so please bear with me. I have a header file called Deck.h and a cpp file called Deck.cpp. In my header file, I have a class called Deck which has prototype function called createPack as … | |
[code=c+] #include <iostream> #include <string> using namespace std; int main() { string a; cout<< "enter string" <<endl; cin>> a; string b; //======================================================== for (int j=a.size(); j>0; j--) { for (int i=0; i<a.size(); i++) { b[j]=a[i]; } } cout<< b <<endl; return 0; } [/code] i want the first character on … | |
Q- Use swapping concept to swap the elements of 1D array consist of 10 integers. Ask the user to enetr the values of array elements then print them out to the screen before and after swapping. e.g. a[0] ----> a[9] a[1] ----> a[8] a[2] ----> a[7] a[3] ----> a[6] a[4] … | |
I'm trying to create an array that will hold the first name of 100 users I tried char fname[100] but I realized that only creates an array that hold 100 char. how do you create an array to hold 100 entries that has a max of 50 chars in each … | |
Hi all my friends, As i'm beginner in VC++, i encountered a lot of problem in debugging. I think my knowledge and academic studies should be distinguished properly. I know only c++ but i have OOP knowledge in c programming. But i am not able to handle the debugging in … | |
I am trying to match a string to see if it follows a given pattern. I have seen this example in my Orielly books but do not understand the logic. Here is the a small snippet of example code: [code=cplusplus] const string digits("0123456789"); const string float_digit = digits + '.' … | |
I am in the process of making a bank account class. I need to put a copy constructor to compare the checking and savings account. Also I need to learn how to insert the checking and savings accounts. I need an assignment operator to assign the checking account to the … | |
Hey everyone. Before i start i'm writing up this code for my mothers employee database. I have attached two files. An example of how it's going to be run through a picture and the employee database which is a .txt file containing data such as first name, last name etc. … | |
Hi I have a homework program to convert from postfix to infix, almost most of the functions are done but i can't make few functions to make the program run correctly Please help me finishing the remaining functions Here is the code [CODE]//------------------------------------------------------------------------------------------------------- // NextToken.h #ifndef NEXTTOKENH #define NEXTTOKENH #include … | |
Ok i am writing a program to manipulate structures that are similar to linked list. I have a file that has these contents. 4 5 0 0 0 0 1 0.1 0 2 0.2 0 3 0.3 0 4 0.4 1 0 1 1 1 1.1 1 2 1.2 1 … | |
Hello all, I am having a bit of trouble overloading the [] operator on a template based LinkedList class. Could you all tell me what I am doing wrong? Thank you so much. Basically it is to provide my template based linkedlist class to act as a normal array. Here … | |
Hi, I'm trying to 'reduce' a vector using the erase algorithm within a for loop. The idea is to scan a table looking for equal successive elements. Once equal elements are found, it erases one of the 2 elements. I'm suspecting a problem in the for loop, due to the … | |
Ok guys, our C++ class is winding down and for our last assignments we are getting some tough problems. We are asked to write a telephone directory program that looks up phone numbers from a separate file that contains a list of names & numbers. The program should prompt the … | |
Hello everyone! I am writing a function to multiply two matricies together. I have written a simple algorithm for a matrix 3x3 - [CODE]void multiply() { int a[3][3], b[3][3], c[3][3], i, j , p, val = 0; a[0][0] = -1; a[0][1] = 0; a[0][2] = 1; a[1][0] = 5; a[1][1] … | |
I know there is a function that if you put the mousecursor over a buttoncontrol, it is possible to have a litte "window" that occur over this button that tells what this button does. I have looked into the members and seen something like this. I am not sure if … | |
hi everyone for my comp sci class i'm supposed to write a piece of code which will take in 10 ints and put them into an array of such size. unless the input is either a 3 or 7 in which case wats left of the array will be written … | |
I have a general wondering about std::vector<string>. If you declare something like this, I have set 1 million elements to this vector. If I run this program just declare it like this without filling the elements with any strings. Does this take up any RAM memory just because I have … | |
I am creating a program on eclipse with multiple classes, using polymorphism. When I compile, I got the following error....Make:***[5] error 1, undefined symbol: do someone know what it is? | |
dear all, wat should i do to clear the input buffer stream? and also make me clear regarding flush and fflush. both do the same functions? | |
when i running this program, i've found that one of the used integer always over load. that is int outq. could someone please help me find out what's make this integer over load at last? thanks. [code=cpp] #include <stdio.h> #include <stdlib.h> #include <time.h> #include <fstream> #include <iostream> #include <string.h> #include … | |
If I want to find the start and end position of the word "how" on these two rows in a textBox. Is there any other approach then substring each line or is it the substring method I am going to use. ? //text in textBox Hi, how are you good … |
The End.