49,756 Topics

Member Avatar for
Member Avatar for Underdog67

Here's the code: [code] #include <iostream> #include <fstream> #include <iomanip> using namespace std; const int MAX_EMPLOYEE = 500; enum PayType{H, S}; struct EMPLOYEE { int idNumber; char name[21]; double payRate; short int numberDependents; enum PayType; }; int LoadMaster(EMPLOYEE& record); int main(){ int count; EMPLOYEE record; count = LoadMaster(record); cout << …

Member Avatar for iamthwee
0
113
Member Avatar for swiftdemise

Hi, I'm having a problem with vectors. I have [code=c++] vector<int> ds; [/code] in a header file. When I do [code=c++] ds.push_back(0); [/code] in the cpp file, I get a seg fault. Does anyone know what the problem is? Thanks

Member Avatar for swiftdemise
0
137
Member Avatar for almost_done

Ok I have no idea why I'm getting this error. I'm guessing its the fact I'm trying to return something from another class but I don't know how else to do it. [code=C++] #ifndef Floor_h #define Floor_h #include <queue> #include "Passenger.h" using namespace std; class Floor { public: Floor(); void …

Member Avatar for Ancient Dragon
0
2K
Member Avatar for sbenware

My program keeps crashing when the retrieve function calls the getName function. I'd like to make sure my getName function is correct before tinkering with my retrieve function. I'd appreciate any ideas. Is there a problem with deleting the name if it's a pointer? header file: [code] void getName(char * …

Member Avatar for sbenware
0
88
Member Avatar for k2k

hi all, I am trying to figure out how to read from a file, ifstream reader reading string next.... if next is a digit then add it to total... and cout total.. please indicate what went wrong. thank you. [code=cplusplus] # include <iostream> # include <fstream> # include <cstring> # …

Member Avatar for Lerner
0
95
Member Avatar for hotshayan

Actually im a beginner with the subject of data structures. for my project i got a program to make which goes like: " implement the ADT unordered dictionary using hashing with linear probing." by using c or c++ language. i would b grateful if sum1 could help me with this …

Member Avatar for Ancient Dragon
0
130
Member Avatar for roxanne14

My assignment says I'm supposed to read in an address all on one line separated by pound signs (eg jane doe # p.o. box 123 # new york, new york 97229 #) and output it with correct capitalization and in proper address format like: Jane Doe P.O. Box 123 New …

Member Avatar for Tight_Coder_Ex
0
550
Member Avatar for prateek_singh

//sample program for car:) #include<graphics.h> #include<conio.h> #include<dos.h> #include<stdlib.h> #include<process.h> void main() { int gd=DETECT,gm; initgraph(&gd,&gm,"c:\tc\bgi"); int c=12; setbkcolor(0); //setlinestyle(0,1,2); int t; while(1) { settextstyle(2,0,5); outtextxy(100,10,"Press L,H ,T,P"); outtextxy(100,30,"Press 1 for Quit"); as: setcolor(13); ellipse(380,127,20,152,130,35); //////////////////////////////rear////////////////////////// line(490,109,560,142); line(560,142,569,142); line(569,142,582,102); line(582,102,620,92); line(593,132,617,125); line(617,124,627,96); line(620,92,628,97); line(472,86,602,96); line(501,113,575,121); line(443,77,475,80); line(443,77,432,93); line(475,80,472,85); //setcolor(4); line(593,132,593,137); line(593,137,600,141); …

Member Avatar for Salem
0
175
Member Avatar for Jakiro

void Display(Productptr t) { Productptr g; g=t; if(t==NULL) cout<<"The list is empty."<<endl; else { cout<<"Code\tDescription\tPrice\n"; cout<<"====\t===========\t=====\n"; while(g!= NULL) { cout<<g->code<<"\t" <<g->description<<"\t\t" <<g->price<<endl; } cout<<"End of the list"<<endl; } system("pause"); } This code give me problem. When I show 1st time is ok. After 1st time I add something or delete …

Member Avatar for Jakiro
0
72
Member Avatar for Ravenous Wolf

here is a question which some would consider silly but i would still love to ask. what are the chances of C# or java replacing c++ as the gaming language? more and more books are being written about game design in C#. c++ has the advantages of being fast and …

Member Avatar for maddog39
0
182
Member Avatar for Thunder2k4

Hi, im currently trying to write a program which counts the characters in an input file. I need it to count the total characters, the non-blank characters and the alphabetic characters. And then show the statistics of each. I have both the total characters and alphabetic characters working correctly but …

Member Avatar for Thunder2k4
0
214
Member Avatar for ZORG

I want to develop a database application for the DS. Which is the best C++ package to use? When I was last involved with programming, Microsoft and another development company that I cant even remember now had the top two products. My current research has made me realize that there …

Member Avatar for jbennet
0
81
Member Avatar for LanierWexford

Is there a function to remove punctuation from a string, or check to see if a char is a letter? This is a home work assignment to: 1 Write a class stack and a class queue 2 Test your classes by writing a program that will ask the user for …

Member Avatar for LanierWexford
0
1K
Member Avatar for tootypegs

Hi, basically i want to parse an image of a small FAT SD memory card that i have aqquired to display its directory structure. Ive tried scowering the web for some information or resources to study but i cn't find anything. Does anyone know of any info available to allow …

Member Avatar for tootypegs
0
79
Member Avatar for Max_Payne

[b]Code[/b]: [b]NumeroReal.h[/b] [code] #pragma once #include <iostream> #include <cmath> #include <cstdlib> using namespace std; class NumeroReal { private: double n; public: NumeroReal(); // default constructor NumeroReal( double n ); // parameter constructor NumeroReal( const NumeroReal &unNumeroReal ); // copy constructor ~NumeroReal(); // destructor void setNumeroReal( double n ); double getNumeroReal() …

Member Avatar for Max_Payne
0
121
Member Avatar for Tell Me

Hi, I want to ask if there function in library of c++ to search word in file ?? thank you

Member Avatar for Tell Me
0
178
Member Avatar for hpr12951

Hello~I am having trouble with my homework. I could not have them done. Please Please help me with it. Thank you all. God bless... The question is ""Add temporary, administrative, permanent, and other classifications of employees to the hierarchy from the three coding. Implement and test this hierarchy. Test all …

Member Avatar for ithelp
0
120
Member Avatar for aloh

Hi, I'm quite a beginner and not sure if I can be helpful in the future. But I'll try! anyway, here is my problem... I've been searching on the net & looking up books but still don't have a clue of how to get it work. I have to simulate …

Member Avatar for Salem
0
121
Member Avatar for Tamarce

I am am for the first time here,since it is the first time I needed help.I have read all the rules and I agree with you for the homework case...But this is getting frustrating!I am working on this on my own,practicing for the mid term but what am I doing …

Member Avatar for Tamarce
0
302
Member Avatar for volia

o.k., so as i stated in my first post, I'm very new to this, and not very good at it. I have been able to get though the labs up to this point. But I am having some issues with my final lab. One thing I want to make clear …

Member Avatar for WaltP
0
135
Member Avatar for mattp123

Hey guys I need some help on this code. I'll just post the parts of the code needed to do thing I'm stuck on. [CODE]class Robot { public: // Constructor Robot(Arena* ap, int r, int c); // Accessors int row() const; int col() const; // Mutators void move(); private: Arena* …

Member Avatar for Lerner
0
77
Member Avatar for curt22

Hello, I'm following this tutorial [url]http://fox-toolkit.net/cgi-bin/wiki.pl?Tutorial__Simple_Window[/url] To learn how to make gui programs using the fox toolkit, but I can't get it to compile. This is what I have in main.cpp [code] #include <fx.h> #include "mywindow.h" FXDEFMAP(MyWindow) MyWindowMap[]={0 }; FXIMPLEMENT(MyWindow,FXMainWindow,MyWindowMap,ARRAYNUMBER(MyWindowMap)); int main(int argc,char ** argv) { FXApp application("Tutorial #1","FOX Tutorials"); …

Member Avatar for curt22
0
154
Member Avatar for driplet

I need to input a space, a tab, and a comma from keyboard and then judge if the input is a space, a tab, or a comma. I used the following code but it doesn't work. bool ST, COMMA; AnsiString HH; HH = Edit1->Text; strcpy(CR, HH.c_str()); if (CR == " …

Member Avatar for Narue
0
4K
Member Avatar for DemonSpeeding

I believe what I have written at the moment is a singly linked list, and I can't figure out how to delete whatever node the user specifies, I've toyed around with it but I'm stumped. Here's my specification file: [code] #include<string> using namespace std; class Node { Node *prev; Node …

Member Avatar for Narue
0
217
Member Avatar for jimFan

Dear all, Is it ever possible to write a programme in C++ which enables me to: 1) Read the data in spreadsheet of MS-Excel 2) generate another Excel file as output ? Also, are there any standard library could do the job? One of my friend said using Visual Basic …

Member Avatar for miketillman
0
1K
Member Avatar for DoctorBob

So I have 4 different algorithms to sort numbers that me and my best friends wrote to see who's worked the best. They are not the greatest ..since we aren't the greatest programmers..haha but we thought it'd be fun. I thought I'd let you guys take a look at them …

Member Avatar for DoctorBob
0
111
Member Avatar for SpiderKing

Im kinda new to programming, so my question is a simple one. I have came across term of data structures, and have been toying with some basic exsamples of them. While [CODE]int *pointer [10]; struct cell{ int death; }; int main () { cell test; cell * pointer[0]; pointer[0] = …

Member Avatar for SpiderKing
0
77
Member Avatar for jrice528

In the retailitem.cpp I need to beable to increment x,y and z. So that is displays the next item. Heres what the code should output [code] Descriptio Units On Hand Unit Price ($) Item #1 Jacket 12 59.95 Item #2 Jeans 40 34.95 Item #3 Shirt 20 24.95 [/code] Heres …

Member Avatar for Narue
0
101
Member Avatar for cmoodc

hi I have a practical exam after 1 hour and i dont know how can i write a 3D rotate function 3D scale 3D translate i need it in general form our teacher has a weak knowledge about his subject plz anyone can help me

Member Avatar for invisal
0
91
Member Avatar for eranga262154

Hi all, I want to store some data pairs. A variable name and the value. I've try it in this way. [CODE] //data map testing map<string, int> my_map;//map map<string, int>::iterator my_it;//map iterator my_map["first"]=10; my_map["second"]=12; string ss = "third"; my_it = my_map.find(ss); if(my_it == my_map.end()) { //insert new value my_map["third"] = …

Member Avatar for Narue
0
89

The End.