48,985 Topics

Member Avatar for
Member Avatar for solthirsty

I think the best way for me to explain this is to show you guys what im trying to do. [code] #include <iostream> class customer { int CustID; public: void CCustRecords(int NumOfCust) { x = NumOfCust; for(int i = 0; i < x; ++i) { cout << "Enter the Customers …

Member Avatar for Dave Sinkula
0
176
Member Avatar for mikecoyner

whenever i use cin.get in a loop it skips over the first cin.get. for example, in the code below, the programs skips over the cin.get for the stu.name?? [code]#include<iostream.h> #include<fstream.h> struct student { char name[20]; char ssn[20]; char dob[20]; float gpa; }; main() { student stu; ofstream outfile; char choice; …

Member Avatar for mikecoyner
0
252
Member Avatar for Mr Violent

Okay, I'm able to set my color key to black easily enough, but I'm having trouble setting it to purple. [CODE] COLORREF colorkey = RGB(180, 0, 180); if (colorkey != -1) { ddck.dwColorSpaceLowValue = colorkey; ddck.dwColorSpaceHighValue = colorkey; pdds->SetColorKey(DDCKEY_SRCBLT, &ddck); } [/CODE] RGB(180, 0, 180) is the purple color I'd …

0
112
Member Avatar for Vincentjames501

How would one change the size of the font and/or the font itself. Im using win32 (I guess.. its not MFC).... Does anyone know how to do this in c++.... Thanks... Vince

Member Avatar for Tight_Coder_Ex
0
303
Member Avatar for dal4488

I'm having quite a difficult time with this program. I'm trying to write a program that calculates the average of the GPAs for male and female students. Each line of my file has an f or an m followed by a GPA. I have to use a sentinel controlled while …

Member Avatar for Dave Sinkula
0
182
Member Avatar for Jankos

Hi, i just started c++ programming in college this semester, and i have a project that i have no idea how to do. Im sure it will be extremely simple to all of you experts, but i just cant think of a way to do it. Maybe some of you …

Member Avatar for Narue
0
99
Member Avatar for Lorita

Hi. I can't figure out what I'm doing wrong here. I know I have to instantiate a Carpet object, assign values then pass the instance to the printArea func. Easier said than done! Thanks for any help!! L #include<iostream.h> #include<conio.h> class Carpet { public: int lengthInFeet; int widthInFeet; }; void …

Member Avatar for Acidburn
0
173
Member Avatar for Acidburn

I have this function: [code] bool Date::testEqual(Date &someDate) { if (Date == someDate) return true; return false; } [/code] but it returns 3 errors , [quote] C:\computer science programming\excerise sheet 5\2 - Date.cpp(91) : error C2143: syntax error : missing ')' before '==' C:\computer science programming\excerise sheet 5\2 - Date.cpp(91) …

Member Avatar for Acidburn
0
163
Member Avatar for mel2005

at the moment this is a stack of queue, i am trying to make it into first in first out, (FIFO) , can anyone help. thank you very much [code] #include <iostream.h> #include <stdlib.h> const int STACK_SIZE = 6; const int NIL = -1; const int LAST_ELEMENT = STACK_SIZE - …

Member Avatar for mel2005
0
159
Member Avatar for fiberoptik

I have a program to write that takes in the date in ##/##/## format. I then write the month day, year output. What I'm totally lost on is how to get from reading the char array to integer numbers?? Big time Lost! Need help!

Member Avatar for Narue
0
192
Member Avatar for rpgplyrff8

I have been working on this project for my C++ class that I am taking and Ive gotten an error message I have never seen before. When I am attempting to execute it i get the flowing error: error LNK2001: unresolved external symbol "int __cdecl s(void)" (?s@@YAHXZ) I have also …

Member Avatar for Dave Sinkula
0
140
Member Avatar for Acidburn

Hello I'm getting 2 errors c:\computer science programming\excerise sheet 4\student\student.h(8) : error C2629: unexpected 'class Student (' c:\computer science programming\excerise sheet 4\student\student.h(8) : error C2238: unexpected token(s) preceding ';' heres the student class: [code] #ifndef STUDENT_H #define STUDENT_H class Student { public: Student(const char *, const Date &); void printStudent(); …

Member Avatar for Dave Sinkula
0
268
Member Avatar for Layla_2401

Hi, I'm using MS visual studio 6 for a C++ program. I am able to run the program from IDE, but when I've attempted to run it from the command line, I get a message the program name is unrecognizable. I've included the following code: [CODE]int main(int argc, char *argv[])[/CODE] …

Member Avatar for Layla_2401
1
216
Member Avatar for Vincentjames501

How would one break out of a function with either pressing the space bar, enter, or 0 key? My goal is to create a timer in c++ that keeps the timer ticking, but when one presses either anykey, or one of the following three keys, then it will stop the …

Member Avatar for aj.wh.ca
0
89
Member Avatar for JoBe

Hi ladies and gents, I wanted to start a new exercise, but after reading it several times, I actually don't know what the exercise is all about :!: The translation into English is this: [quote]Write a function wich can be declarered as the following: unsigned int datecode(int year, int month, …

Member Avatar for Narue
0
397
Member Avatar for mb1

[code] /* Write a program that requests a file description (word) and a string from the user then states the number of occurances of the string in the file. (We will search for the word 'the'.) If the file does not exist, the program should state this to the user.*/ …

Member Avatar for mb1
0
179
Member Avatar for kohkohkoh

In C++, I would like to know how to use the function arrow to select things for example: ape boy cat dog by default the highlighted bar is at ape and i want to select cat....so i use the down arrow button to select cat my question is ...how can …

Member Avatar for Narue
0
40
Member Avatar for crestaldin

[COLOR=Navy][FONT=Comic Sans MS]Can anybody help me with a code to clear the screen using C++. I have a program that has to continuously make changes to an array and display the array after each modification. All I need is a code to clear the screen after each display. Thank you[/FONT][/COLOR]

Member Avatar for alc6379
0
138
Member Avatar for Acidburn

When running the following code i get a big compile error: [QUOTE] Linking... main.obj : error LNK2001: unresolved external symbol "public: __thiscall debug::debug(int)" (??0debug@@QAE@H@Z) Debug/main.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. [/QUOTE] Class definiation saved as : class.h [php] #ifndef CLASS_H #define CLASS_H class debug { …

Member Avatar for Dave Sinkula
0
560
Member Avatar for tenoran

Could anyone define "Memory leaks" well ? 'cause pretty hard for me to understand with C++ books.

Member Avatar for Acidburn
0
88
Member Avatar for Fasola

I know about double arrays but haven't heard of a triple array It maybe a stupid question, but do they exist? example (obviously not real code): X = length Y = width Z = height array[x][y][z] = some point located somewhere in the area of a cude OR have you …

Member Avatar for Fasola
0
277
Member Avatar for dave2point0

Hi, I am making some software for microchips. I am currently developing some algorithms or the PC, and was wondering if there is a way to access a mouse button in very simple C, not c++, in the form of a variable, either on or off. Also, switch bounce is …

Member Avatar for dave2point0
0
152
Member Avatar for JoBe

Hi ladies and gents, I made this exercise in wich recursion has to be used and it worked as it should: [CODE] void ggd(short x, short y) { short a = 0; if (y == 0) { cout<<"The largest common divider is: "<< x <<endl; } else { a = …

Member Avatar for JoBe
0
166
Member Avatar for tat2dlady

I am doing a 5-way balanced sort merge. I have 1, 000, 000 records and a toal of 10 temp files to work with (5 for input and 5 for output). After phase 1, the temp files F0 thru F4 are populated with clumps of sorted records. The clump size …

0
88
Member Avatar for Vincentjames501

Hey Guys, im trying to create a timer in c++ that starts at one, and every second the program displays the next number starting from -15, i have the start, but what i want is a breaker button... Such as while its counting, i want to be able to press …

Member Avatar for Vincentjames501
0
145
Member Avatar for Maple_Tiger

I keep seeing these two words in Sams teach your self C++. Do they represent the same thing when talking about variables? I beleave that I know what "define" means. State it's type, it's name, and semicolon. However, I see that "declare" is used for, what seems, the same meaning. …

Member Avatar for Maple_Tiger
0
184
Member Avatar for sasha16

Hello, I have been working for hours trying to get my mortgage calculator program to work. The purpose of the program is to allow user input of the loan amount, interest rate, and term in years, and then display the mortgage payment amount. I also have to list the loan …

Member Avatar for Dave Sinkula
0
145
Member Avatar for Acidburn

This is gonna take some time, anyway here it is: the student class : [PHP] #ifndef STUDENT_H #define STUDENT_H class Student { public: Student(const char *, const char *, const Date&, const job&); char * getfirstName(); char * getlastName(); void getbirthdate(); void getjobnumber(); private: char firstname[25]; char lastname[25]; Date birthdate; …

Member Avatar for Acidburn
0
132
Member Avatar for shouvik

"THINKING IN C++" a real cool book in C++ is available online and can be down loaded free of charge. The site is!!! [URL=http://www.codecuts.com/mainpage.asp?WebPageID=315]http://www.codecuts.com/mainpage.asp?WebPageID=315[/URL]

Member Avatar for Saelice
0
295
Member Avatar for ncat_08

I have two programs that i have to write by next friday (april 1 ) but i have no idea how to do them. Can someone please help me out. These are the [B]conditions for the 1st one:[/B] 1) read floating point numbers into an array until teh sum of …

Member Avatar for ncat_08
0
86

The End.