49,761 Topics
| |
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 … | |
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; … | |
when using #include <iomanip> ; what is the syntax for formating numerical values for currency - example 123456, format to $123,456. Using the cout << command. | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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& … | |
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 … | |
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 … | |
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; … | |
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 … | |
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 | |
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 … | |
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 … | |
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 … | |
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) … | |
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 - … | |
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! | |
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 … | |
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(); … | |
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] … | |
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 … | |
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, … | |
[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.*/ … | |
| 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 … |
[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] | |
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 { … |
The End.