51,593 Topics

Member Avatar for
Member Avatar for shasha821110

Hi, all i have one assignment about using some of the STL to read from .txt file and count the words and find the topnwords etc. So i implement my class like that: [CODE=c++] class A { public: A( const string& filename ) { ifstream file( filename.c_str() ) ; string …

Member Avatar for tux4life
0
133
Member Avatar for kelechi96

Hello I have created a sucsessful prime number finder however I wish to retrive the start number from a file the last line shows how I tried to do this however it failed any solutions ? [code=C++]/* By Kelechi Nze My first prime project*/ #include <windows.h> #include <iostream> #include <fstream> …

Member Avatar for kelechi96
0
184
Member Avatar for mat1989

Hi guys. Im doing an assignment, I am getting on ok with it but I am sadly really stuck at the moment. The part I am stuck on involves counting html tags in a text file. I have thought of a method of doing this but unfortunately I have no …

Member Avatar for Xlphos
0
1K
Member Avatar for f.ben.isaac

Please tell me what do you think of the written code below, is it easy to follow? Does the code tells you what it does, or you have struggled realizing whats going on? and so on. Feel free to give suggestions, tips, advices and criticize! This will help me and …

Member Avatar for f.ben.isaac
0
274
Member Avatar for greg022549

Going through one of my old .c file I have a line as follows: scanf("%i", &tside); I would like to convert it c++ code. Can someone show me how to do that? Sincerely, greg022549

Member Avatar for adam1122
0
118
Member Avatar for f.ben.isaac

1. Simple calculator - nothing fancy [code]/**program description: * * simple calculator written for beginners. * This program asks user to enter an arithmetic * expression that contains two numbers and one * operator. User will be given the result of the * calculation. Operators allowed to be used * …

Member Avatar for tux4life
0
269
Member Avatar for vijaysoft1

Please give me the logic or a simple program to convert a Roman letter to Numeral . Please.......

Member Avatar for siddhant3s
0
100
Member Avatar for hurbano

this simple cout statement and i do not know why. the outputs are mixed up and i get some random numbers i didnt even input.please help [code=cplusplus] #include <iostream> #include <string> using namespace std; int main() { string Pname, CEmployer; int age; cout<<"Patients Name:"<<endl; getline (cin, Pname); cout<<"Age:"<<endl; cin>>age; cout<<"Current …

Member Avatar for tux4life
0
121
Member Avatar for everydaybh

I want to create a program that asks the user to enter two vector (size and direction), and calculates its addition through turning it into components (using OOP). here's what I've got so far (I don't know how to fix the errors), I'm not sure what's wrong/ to do next …

Member Avatar for tux4life
0
179
Member Avatar for deppsgirl

hi. this is my first post here, my name is jen, someone in my class told me about this site and how helpful all you guys are and im so lost i thought id come try and see if someone can help me understand :( i dont even know where …

Member Avatar for tux4life
0
171
Member Avatar for jam7cacci

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 …

Member Avatar for jam7cacci
0
176
Member Avatar for NicAx64

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 …

Member Avatar for Will Gresham
0
535
Member Avatar for Nemoticchigga

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 …

Member Avatar for ArkM
0
136
Member Avatar for gangsta gama

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 …

Member Avatar for gangsta gama
0
125
Member Avatar for mampam

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 …

Member Avatar for Ancient Dragon
0
82
Member Avatar for ganmo

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, …

Member Avatar for ganmo
0
128
Member Avatar for clutchkiller

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 …

Member Avatar for clutchkiller
0
229
Member Avatar for kavithabhaskar

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; …

Member Avatar for siddhant3s
0
149
Member Avatar for tomtetlaw

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 ); } } …

Member Avatar for MosaicFuneral
0
66
Member Avatar for Samuelandjw

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 …

Member Avatar for Sky Diploma
0
125
Member Avatar for everard

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() …

Member Avatar for MrSpigot
0
367
Member Avatar for yingfo

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 …

Member Avatar for Nick Evan
0
159
Member Avatar for acoxia

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 …

Member Avatar for acoxia
0
96
Member Avatar for carolinepoland

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 …

Member Avatar for tux4life
0
119
Member Avatar for badboizEnt

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.. …

Member Avatar for badboizEnt
0
145
Member Avatar for FREEZX

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 …

Member Avatar for FREEZX
0
295
Member Avatar for perumar

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 …

Member Avatar for tux4life
0
286
Member Avatar for danishamman
Member Avatar for vishy_85

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 …

Member Avatar for vishy_85
0
151
Member Avatar for dragon_vn_101
Member Avatar for ithelp
0
76
Member Avatar for Behi Jon

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 …

Member Avatar for siddhant3s
0
127
Member Avatar for mushbucket
Member Avatar for mushbucket
0
91
Member Avatar for 1newguy

[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; …

Member Avatar for siddhant3s
0
169
Member Avatar for Dragonsfire

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 …

Member Avatar for vmanes
0
151
Member Avatar for u8sand

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) …

Member Avatar for u8sand
0
156
Member Avatar for shadowmann2330

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 …

Member Avatar for ArkM
0
142
Member Avatar for guest7

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

Member Avatar for tux4life
0
66
Member Avatar for richhoggan

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 …

Member Avatar for Intrade
0
444
Member Avatar for songweaver

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 …

Member Avatar for songweaver
0
196
Member Avatar for Crago3

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 …

Member Avatar for Narue
0
459
Member Avatar for cbreeze

Ok so this is what I am trying to do but seem to have a problem with my input loop because it keeps reading in only the first set of student data. I am also unsure where to put the cin.ignore because my getline function is not working. Please fogive …

Member Avatar for cbreeze
0
112
Member Avatar for 123james456

Can you compare strings with if, or do you have to use something else? Can you compare strings at all? Im attempting to write a console program just for fun. Eventually I want it to be able to move around files and such but im not even close to that …

Member Avatar for 123james456
0
104
Member Avatar for atreides27

"Define a class Student that has as its members the student_name and a student_idnumber both of type string. Input from the keyboard the number of students in the database, then create a dynamic array of type Student and input the information for each student. Once you populate the database (stored …

Member Avatar for jbennet
0
268
Member Avatar for u8sand

Hello everyone, i have not posted here in a while. But i have a question about a string class I'm creating. Every time i make a string class this always happens, and i cannot figure out why. Maybe its something i didn't include or something i have to add. But …

Member Avatar for tux4life
0
124
Member Avatar for endisbegun

so i have some code that ive been working on, and dare i say, understanding, involving linked lists, only i've hit a wall I need to add a new structure, called date, so that a day, month, and year, are associated with every node, for rolls, jam, and tea, and …

Member Avatar for endisbegun
0
128
Member Avatar for halfnode

[CODE=Cplusplus]#include "STDAFX.H" #include <iostream> #include <iomanip> #include <string> using namespace std; class Transfer { protected: string Name; public: void transfer(); void xfer(string); }; class Exchange { protected: string exchItems[4]; public: void exchange(); string exchange(int); }; class Voucher { protected: string vnumber; string company; double amount; public: Voucher(string, string, double); void …

0
92
Member Avatar for Riskboy999

hi guys, im new at the forum and would like to ask for assistance with a programming assignment. First the Question.. [COLOR="Green"]DEVELOPMENT OF A C++ PROGRAM FOR A STUDENT RECORD SYSTEM. You are to develop a student record system that makes use of the C++ structure and classes. The record …

Member Avatar for Riskboy999
1
3K
Member Avatar for nschessnerd

I need a nonblocking socket so in an older version of the program i made a new thread to do this. and now that ive migrated into visual c++ it crashes with no explination... yea im really aggravated... can anyone tell me why this crashes? [code] #include <iostream> #include <winsock.h> …

Member Avatar for nschessnerd
0
97
Member Avatar for sfrider0

I have been working on this for a few days now. I'm just trying to make a deep copy of a template linked list. I have successfully copied the list, but when I enter a new item to the new list, it also adds it to the original list. I'm …

Member Avatar for jencas
0
121
Member Avatar for nschessnerd

Hey so as i mentioned here [url]http://www.daniweb.com/forums/post840142.html[/url] i need to check if a process is responding by using sendmessage however i have no idea how to get the hwnd because i start the process using system::diagnostics::process [CODE] process->StartInfo->WorkingDirectory=sinfo->workingDirectory; process->StartInfo->Arguments=" -exec "+sinfo->init+" -port "+sinfo->port+" "+sinfo->options; process->StartInfo->FileName = sinfo->exe; process->StartInfo->UseShellExecute=true; [/CODE] so …

Member Avatar for seanhunt
0
1K

The End.