49,756 Topics
![]() | |
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 << … ![]() | |
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 | |
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 … | |
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 * … | |
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> # … | |
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 … | |
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 … | |
//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); … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
[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() … | |
Hi, I want to ask if there function in library of c++ to search word in file ?? thank you | |
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 … | |
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 … | |
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 … | |
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 … | |
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* … | |
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"); … | |
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 == " … | |
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 … | |
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 … | |
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 … | |
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] = … | |
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 … | |
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 | |
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"] = … |
The End.