49,761 Topics
| |
my task is to sort the input numbers from lowest to highest but i just cant make it work... i've tried different ways and I know there's a problem in my code. hope you can help me out. thanks! [code] #include <iostream.h> struct trial { int age; } getcount[5]; void … | |
ahh , finally I backtrack the bug. Believe me I'm not saying that I'm experienced but many years I have been working with C++ , at least 5 yrs .I'm working with the C compiler since I was at the 7th grade. however the fun part is not boosting about … | |
This is a general question. I am familiar with accessors and mutators (getters and setters). I have now been reading up on semaphores. I am having trouble finding out differences between them/how they are related. Can anyone help me out with an explaination or a link? Thanks. P.S. - sorry … | |
Hello all, My code isnt working. It is supposed to be a RPG World of Warcraft game lol. 1) When I have [code=c++]if (inventory.size() == MAX_ITEMS) { inventory.push_back("Rusty Armor"); } else { deleteItem(); } [/code] 2) My deleteItem() function dosnt work, is their another way to do this? Here is … | |
I have a main that I want to use getline to get the user's words after i do a strtok to eliminate these delimiters (" ,.-") and then find the soundex code of each word and insert the words into my hashtable. i made an attempt but i was not … | |
Hello, I've written a delete function to delete any integer value based on in parameter. The problem I have now is that this function deletes the values, but leaves the Node position intact with some huge int value instead. So my question is, do I need to rearrange the Node, … | |
When I declare an event table in a class a.k.a DECLARE_EVENT_TABLE(); then try to compile, i always get this error: [Linker Error] undefined reference to `vtable for Utility' (utility being my class) What does this mean and how do I fix it? All research on this has turned up dead … | |
Hi I am learning C++ and i coded this program but it isnt working as it was supposed to.. [CODE] #include<iostream.h> using namespace std; class furniture { protected: int color,width, height; }; class bookshelf : public furniture { private: int no_of_shelves; public: int accept() { cout<<"enter color"<<endl; cin>>color; cout<<"enter width"<<endl; … | |
I am doind a tutorial, here is my code: [code=c++]#include "functions.h" #include <glut.h> #include <stdlib.h> //this is the function with the error: void HandleKeyPress ( unsigned char key, int x, int y ) { switch ( key ) { case 27: // escape key exit ( 0 ); } } … | |
I use VS C++ 2008, and I have the following code [code=C++] int main() { int maze_size=5; int[3][2] oppo_pos = { {maze_size-1,maze_size-1}, {maze_size-1,0}, {0,maze_size-1} }; return 0; } [/code] When I compiled, VS gave out the following error messages: 1>c:\dev\visual studio 2008\projects\test\main.cpp(4) : warning C4091: '' : ignored on left … | |
I have the following codes: [code=cplusplus] void CLOGFILE_INTERPRETERDlg::OnBtnLoad() { AfxGetModuleState()->m_dwVersion = 0x0601; //corrects the differences in MS DAO UpdateData(); m_Loading = _T("Loading..."); UpdateData(FALSE); UpdateData(TRUE); //UpdateData(); int length = 0; try { char strFilter[] = { "Log Files (*.log)|*.log|All Files (*.*)|*.*||" }; CFileDialog FileDlg(TRUE, ".log", NULL, 0, strFilter); if ( FileDlg.DoModal() … | |
Hi I was wonder if anyone could help with this problem I am receiving. My program is suppose to read in any character frequencies from a file, even spaces and /n. My problem is that is reading an extra character that I can figure out. I had inputed a text … | |
hello I been working on a swap program and this is about my third one trying to get it working now I'm having a problem i keep getting 0's added into it right now the output is 4, 0 , 5, 0 ,16. Could anyone tell me where the 0's … | |
Dears! My name is Caroline and I come from Poland. I am looking for help in my C++ problem. Sorry for my poor English, I hope You will understand me. This is my problem: I have to make some program: Make a recursive function which have a parameter - array … | |
please am having a problem with my code below. am actually want is when a numebr lesser than 0 and greater than 99, it should output an error message till the correct value is entered for the three numbers. please would be very greatful if my code could be edited.. … | |
Hello all! I have a task to code a program that would find the last non-zero digit of the factorial of a given number n where 1<n<10000 so far i got this: [CODE=c++]#include <iostream> #include <string> #include <sstream> using namespace std; int main() { int a, xxx; unsigned long long … | |
Write a program that accepts a string input from the user and reverses the contents of the string. Your program should work by using two pointers. The “head” pointer should be set to the address of the first charter in the string and “tail” pointer should set to the address … | |
Plz also teel how it is used in C++ | |
hello all , i have my idl defined as follows : [code=cplusplus] #ifndef schedule_Mgmt_idl #define schedule_Mgmt_idl module schedule_Mgmt { //*************************** Structures ******************************* struct planData { string planName; string planDescription; string scriptExec; string startDate; string startTime; string stopDate; string stopTime; string delayInt; boolean repeatDelay; boolean notOnWeekend; boolean validity; string tempTime; string … | |
i need the code of funtion "gets" in class "string.h". thanks a lot | |
What is the difference between this two codes for Complex class ? What is the preference of code that written by pointers ? Thanks ... First code with pointers : [code=cplusplus] //Complex.h #ifndef COMPLEX_H #define COMPLEX_H class Complex { public: Complex ( double = 1, double = 0 ); void … | |
What's the easiest way to open a directory in windows explorer? | |
[code]//This program reads a course score and prints the //associated course grade #include <iostream> using namespace std; void getScore(int& score); void printGrade(int score); int main() { int courseScore; cout << "Line 1: Based on the course score, \n" << " this program computes the " << "course grade." << endl; … | |
I appear to need some help with a sudoku solver I'm working on. It's supposed to check the row, column, and grid. When I run my program it displays the puzzle, but then it ends abruptly. I was hoping someone can take a look at my functions and see if … | |
Well, i thought everything was perfect since my last post. But i have the strangest error. Maybe its because i don't completely understand references... So anyway here is my string class: [code] class StRiNg { public: StRiNg(); StRiNg(const char* const); StRiNg(const StRiNg&); ~StRiNg(); StRiNg& operator=(const StRiNg&); char &operator[](int); char operator[](int) … | |
do { cout << "and how many of the 4 opponents would you like to play aganst?"<<endl; cin >> numberofopponents;//were the user inputs the number of opponents if(numberofopponents==1)//the if statment that plays the game if the user choses 1 opponents { cout<<"1 opponent......really????? ... noob"<<endl; cout << "round one!"<<endl; cout … | |
Hi, I am getting the following error while compiling the code on linux machine. "aggregate value used where an integer was expected" I am getting this error on a simple for loop. I do not know the reason for this error. Any help is appreciated. Thanks | |
I am working on a programming assignment for class and having a little trouble. The biggest trouble I am having is working with arrays and doing the hex calculations, then making the conversion back to decimal. I have included the assignment description below: Write a C++ program to perform addtion … | |
Hey guys I was wondering if you could provide some help, It is pretty complex for a person who is just starting loops. I have included the problem as well as the code I have below. Please help me, I know their is something wrong with my [B]for[/B] loop as … | |
Hi I am having a problem in the sixth edition on starting out with C++ programming. I need the full code of how to do it cause I am getting errors and dont know what I am doing. The question ask.Write a funtion named coinToss that simulates the tossing of … |
The End.