49,761 Topics

Member Avatar for
Member Avatar for bobr_1013

The problem I'm having is this: I have a table [MAX_ELEMENTS] [18] where the MAX elements can be as high as 100,000. The length of each element is 18 characters. What I doing is simply loading in full 18 character records into this table. The problem I'm having is that …

Member Avatar for bobr_1013
0
154
Member Avatar for mdbrock7

I am in a beginner C++ class and I have a homework problem where I must to find the greatest common divisor through subtraction. I am totally lost. Can anyone show me what I am doing wrong? #include <iostream> using namespace std; int main () { int m; int n; …

Member Avatar for Narue
0
277
Member Avatar for dallin

when using #include <iomanip> ; what is the syntax for formating numerical values for currency - example 123456, format to $123,456. Using the cout << command.

Member Avatar for dallin
0
168
Member Avatar for Acidburn

Got bored, and whats better than spending your time learning. So I'd thought I'd create something fun, [code] #include <iostream> using namespace std; int main() { char array[5] = "John"; //chosen hangman char array2[5]; //populates with * char key; //ets a key from the user int life = 5; int …

Member Avatar for Narue
0
202
Member Avatar for xsxixtxhx

I have this program that is supposed to take in numbers from the Main cpp file and add them to the link list. Eventually i have to sort them then display them on the screen. For right now i am just trying to insert them to the link list but …

Member Avatar for Narue
0
157
Member Avatar for shock1

Write the definition of a function printAttitude , which has an int parameter and returns nothing. The function prints a message to standard output depending on the value of its parameter . If the parameter equals 1, the function prints disagree . If the parameter equals 2, the function prints …

Member Avatar for Narue
0
387
Member Avatar for shock1

Write the definition of a function printLarger , which has two int parameters and returns nothing. The function prints the larger value of the two parameters to standard output on a single line by itself. this is what i have so far: void printLarger(int, int){ } I have to write …

Member Avatar for Narue
0
194
Member Avatar for Acidburn

hello, I kep getting : [quote] C:\computer science programming\excerise sheet 6\cheque account\3 - Bank.cpp(100) : error C2614: 'cheque' : illegal member initialization: 'Balance' is not a base or member Error executing cl.exe.[/quote] [php] #include <iostream> using namespace std; class BankAccount { public: //void setAccount(int num, double amount); taken out replaced …

Member Avatar for Acidburn
0
140
Member Avatar for The_Diceman

Help me if you can please ??? Got so far on my project and know gone brain dead!! Project is for company called Zenith Paints ( please someone reconise this) (The first program in the Visual C++ project is a validation program. You are required to validate three different types …

Member Avatar for The_Diceman
0
186
Member Avatar for missy

how do u rewrite the infix to postfix conversion using class. i have my code from struct stack type. [code]#include <iostream> #include <cstring> using namespace std; const int SIZE = 20; private: int top; char num [SIZE]; public: void stack_init (stack_type&); void push (stack_type& , char); void pop (stack_type&, char& …

0
76
Member Avatar for rharvison

This is my very first introduction to C++ and I am stuck with a very simple mini-calculator project. I cannot figure out what the errors are that the compiler is showing. I have shown my written code and the compiler messages below that. I am receiving syntax errors on the …

Member Avatar for rharvison
0
113
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
253
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
113
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
311
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
183
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
165
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
204
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
142
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
269
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
217
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
90
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
398
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
140
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
570

The End.