49,756 Topics

Member Avatar for
Member Avatar for handytxg

Hi guys, I have list of class contain list of another class. [code] MyMessages class { ID list <myPackets> Packets; } myPackets class { Seq Text } [/code] I need advice which one is the right way to set myMessages class?? [code] void set_myMessages(const int &ID, list <myPackets> Packets) [/code] …

Member Avatar for handytxg
0
178
Member Avatar for starter

Hi Im writing this sorting program. A user can enter a First Name and Last name (10 for now). It stores them in a string. Then a user can enter 10 numbers. The program sorts the numbers and then displays the names assciated with the numbers in order. [code] #include …

Member Avatar for mvmalderen
0
96
Member Avatar for thornside

Hi, I need to read a file character by character and send it to cout at the same time. I have used get(char) but cannot lose the newline character. I'm quite new to C++ and havn't yet grasped the concept behind c-strings/strings. Code so far.. while(in.get(n)) { if (n=='\n') { …

Member Avatar for mvmalderen
0
113
Member Avatar for Clockowl

My goal is to create a program that plays Mahjong. I figured the algo would be a bit like this: [code] While there are blocks left { Fetch new board Recognize blocks //find 2 of the same images within the image. Find free blocks //not *really* necessary: computer versions don't …

Member Avatar for mvmalderen
0
182
Member Avatar for 123qwerty123

I'm trying to store a list of names in alphabetical order, while implementing this linked list, but I've bumped into some errors. I have my problems (like 'node' no appropriate default constructor, and 'first' undeclared identifier). This is what I have: [code] Node.h class node {public: node(node* , node* , …

Member Avatar for NicAx64
0
191
Member Avatar for jlanglopez

I'm writing a program that simulates road traffic, I have a vector of integers inside a structure, which is itself the elements of a vector. Everything works fine except the iterator i use to delete elements of the inbedded integer vector seems to be going out bound and then when …

Member Avatar for jlanglopez
0
84
Member Avatar for FREEZX

I need to write a program that will count how many numbers within an interval have an even sum of digits. you are given two numbers, a and b. i wrote a little program that is a little slow.. it checks for the sum of the digits for every number …

Member Avatar for mvmalderen
0
1K
Member Avatar for rEhSi_123

Hello Guys! Need some help. I basically want to align my menu to center. I have tried the following: 1 . SetConsoleCursorPosition(); 2. gotoxy(); ....etc But none what so ever works..... Here is my code menu: [code=c++] void printMenu() { void Bottomline(char *text); void Headline(char *text); void EmptyLine(); int ans; …

Member Avatar for rEhSi_123
0
112
Member Avatar for blerina12

Hello guys. I have developed a program which is supposed to read several times from the same file. I have used clear() and seekg() but nothing works. When the file gets open for the second time the program doesn't read anything from it. I would appreciate any suggestions. Here is …

Member Avatar for blerina12
0
208
Member Avatar for beschi

Dear Friends... I am new to driver development. I don't know what tool to use to develop drivers. please provide some links to find the link.. I would like to develop a minifilter to monitor and control the file system activites can anyone help me... if you know plz mail …

Member Avatar for Ancient Dragon
0
112
Member Avatar for halfnode

hi all, me again, i need to create an array within a function but somehow i'm getting errors. anyone can enlighten me? [code=cplusplus] string TravelVoucher::exchange(int i) { const int tix = 3; TravelVoucher::exchItems[tix]={"Dinner for TWO at BestFood Restaurant", "Buffet for TWO at EatTillDrop", "Ticket for TWO for Singapore Flyer", "High …

Member Avatar for siddhant3s
0
147
Member Avatar for badboizEnt

i have a program, which uses a password inputation but when i made the password encrypted. when inputting my password which now appear as star(***) due to encryption. trying to delete a character but backspace is being read as a character. please can someone show me the way forward... thanks …

Member Avatar for way29
0
1K
Member Avatar for orcsoul

My brain has just switched off on me... have an easy program to write for a C++ class that involves a for loop with a running total, but my brain has shut down on what needs to be put into the for loop to complete the program. The program needs …

Member Avatar for siddhant3s
0
530
Member Avatar for anjaly grace

//This code works for turbo c++ //Solution for strongly connected components or Kosaraju's algorithm //for nitc students //I use this because there is no other way i know how to do post a //code. ///////code:- #include<iostream.h> //#include<math.h> #include<conio.h> //int time; //time=0; char color[10]; int s[10]; int f[10]; int nn; int …

-1
85
Member Avatar for 1newguy

[code] #include <iostream> #include <string> #include <iomanip> using namespace std; void getData(char marital, int numberofKids, int& exempt, int& numberofPeople, double& grossSalary, double& penAmt); double taxAmount(double taxIncome, int perExempt, double taxRate); int main() { double grossSalary; double penAmt; int numberofPeople; char marital; int numberofKids; int exempt; double taxIncome; double taxRate; getData(marital, …

Member Avatar for siddhant3s
0
91
Member Avatar for bit9435

I have a homework assignment that I'm stuck on...i have to make a program that works like text messaging on a cell phone. It uses three classes, keypad, display, and texter. keypad - is the keypad. it allows the user to enter all alpha-numeric characters. the class handles input. it …

Member Avatar for Clockowl
0
108
Member Avatar for eck3ko

HI! i have two dlls one is in c# and the other in c++ i need to send a string from the c# to the c++ :S i've tried many ways i found all over internet but always i receive garbage inside c++, any example on how to do it? …

Member Avatar for thegrovesy
0
72
Member Avatar for xVent

Hello guys , i searched for over 2 hours how to add a messagebox when i click my button Visual C++ 2008 , in a windows app .. and i cant do it .. if any1 knows how to , please post and if anyone knows any guide or here …

Member Avatar for Ancient Dragon
0
183
Member Avatar for liveshell

Hi all, I am new to linux and got problem with pthread_mutex_trylock(). I have used mutex in my code. When I try to call pthread_mutex_trylock() on RECURSIVE type of mutex it overwrites adjacent memory location (that is global variable of type structure say x, memory allocated using malloc()). Actually I …

0
58
Member Avatar for guest7

Hi, I am getting "Segmentation fault" error in line number in the following function. [ICODE]deque <string> text; deque <string> text_1; int circuit::writetofile(int maxno,char *fname) { /* Before writing the clauses correct the line p cnf */ //deque<string> text; std::string s,t; /* Counting the number of original clauses in the file …

Member Avatar for nucleon
0
236
Member Avatar for songweaver

Hey guys, I am working on a fraction program where you can add, divide, subtract, multiply, and divide and it uses addressing. Anyway I got it to work except when I added an error message if to make sure that the 2nd Numerator, 1st and 2nd Denominator are not zero. …

Member Avatar for songweaver
0
88
Member Avatar for halfnode

[CODE=Cplusplus]#include "STDAFX.H" #include <iostream> #include <iomanip> #include <string> #include <fstream> #include <cstdlib> using namespace std; class Subject { private: string code; int cu; char pf; public: Subject(void); void setCode(string); void setCU(int); void setPF(char); }; class Student { private: string name; int count; int totalCU; Subject subjects[4]; public: Student(void); void setName(string); …

Member Avatar for halfnode
0
187
Member Avatar for archiphile

I am not only new here, but, I am a complete newbie to programing. I was on the hunt for some beginner tutorials today on the web. I found what I thought would be a simple yet in depth problem. I spent the last hour making sure that I had …

Member Avatar for RayvenHawk
0
172
Member Avatar for scarebyte

Hi guys, I have a question concerning the following code I have written for a final project in an entry level C++ course. My task requires 3 level hierarchy (which i have) and use of polymorphism. The program works in this state, but I dont think I am actually exercising …

Member Avatar for scarebyte
0
766
Member Avatar for lancevo3

I have to write a function that takes an input such as this chevrolet, MALIBU and makes chevrolet into CHEVROLET and MAILIBU into Malibu I am having no trouble with capitalizing the CHEVROLET but when it comes time for the Malibu to be corrected it doesn't come out right. directions …

Member Avatar for Clockowl
0
158
Member Avatar for ammonation42

i am at uni an i have a project in which i have to create a backgammon game. i have created the board the dice and the moves, now i need to do the legality of the moves i was wondering if anyone had an idea of how i would …

Member Avatar for jephthah
0
92
Member Avatar for lancevo3

I'm working on a program which requires me to read in a file of input and organize it by calling a few functions. The first function I'm writing breaks up the input and assigns it to the appropriate array. For some reason what I keep getting back is random values. …

Member Avatar for lancevo3
0
212
Member Avatar for sabian4k

I don't understand what getstream is about nor do i know how to change a certain part in an array to something else. please help me. [code] // ************************************************************************** // // Airplane.cpp // // Program that displays the seat diagram for an airplane and allows the user // to select …

Member Avatar for Lerner
0
149
Member Avatar for danishamman

Plz provide me complete discription of four algorithms used for sorting arrays e.g bubble sort.

Member Avatar for jephthah
0
224
Member Avatar for camonchain

([I]Invoice class[/I] Create a class called Invoice that a hardware store might use to represent an invoice for an item sold at the store. An Invoice should include four pieces of information as instance variables— a part number (type string), a part description (type string), a quantity of the item …

Member Avatar for jephthah
0
188

The End.