49,757 Topics

Member Avatar for
Member Avatar for blee93

[CODE]#include <iostream> #include <cstring> using namespace std; class Cow { char name[20]; char * hobby; double weight; public: Cow() { strcpy(name,"peter"); strcpy(hobby,"nothing"); weight = 1.0; } Cow(const char * nm, const char * ho, double wt) { int len = strlen(ho); strncpy(name,nm,19); name[19] = '\0'; hobby = new char[len + …

Member Avatar for blee93
0
230
Member Avatar for rlamarche

Need a standard fifo algorithm. for a cpu shceduler so one command comes in at a time. Please help Thank yOu

Member Avatar for template<>
0
122
Member Avatar for tehmarto

Hi all, I'm developing a program and I want a way to print out French characters. When I post the French characters in the menu, like this [code] AppendMenu(hSubMenu, MF_STRING, NEW_LIST, L"ç"); [/code] The ""ç" shows with no problem. But I wanna make it to show either in an editable …

Member Avatar for tehmarto
0
399
Member Avatar for bleedsgreen33

Hello everyone. I'm coming to you again because you all seem to be much more on the spot answering my questions than my professor. The long story short, we are being introduced to structs in my c++ class, and for the first assignment we are to do a simple Student …

Member Avatar for bleedsgreen33
0
143
Member Avatar for Muhammad Sumair

Please figure out the error in the code and how to correct it ? Actually i want to use a 2d dynamic array. # include <iostream> using namespace std; int main() { int number_of_rows = 0; int number_of_cols = 0; int a=0; cout<<"Please enter the no. of rows : "; …

Member Avatar for template<>
0
145
Member Avatar for efficacious

Hello all, I'm trying to write a binary to decimal conversion program. I'm stuck at the very beginning here because I can't figure out how to allow the user to input the entire binary string while allowing me to break it apart and process it.. I've tried [CODE] int BinInput[*]; …

Member Avatar for pseudorandom21
0
165
Member Avatar for carlo0133

i badly need a hand on this. i have an assignment on my subject, it says that i have to put an MP3 on my C++, so how is it possible??

Member Avatar for template<>
0
148
Member Avatar for caltech

All was good and properly aligned until I changed the variable type from int to double for GrossPay, GrP and totGrP. After the Hours column (from Gross Pay on), in all the rows where there are fewer digits, the Gross Pay, Tax, and Net Pay columns are left aligned, totally …

Member Avatar for Dingbats
0
149
Member Avatar for hanvyj

Hello everyone. I'm a bit new to c++. I'm trying to write a game loop (see the code below) and I'm getting some weird behavior with the GetSystemTime(). I ran through it with the debugger and I get things like this: startTime = 452 endTime = 210 And nothing seems …

Member Avatar for hanvyj
0
193
Member Avatar for DaniwebOS

So I need to program a code which will display the values of all my objects which currently are "Monday and Tuesday." I am getting two errors under my printDay function. Error c2275 'DayOFTheWeek': illegal use of this type as an expression Error c2228: left of '.printDay' must have class/struct/union …

Member Avatar for template<>
0
230
Member Avatar for muze

hello guys.... I have time in char[] format but I need to convert it to CString. Here is what I have but it does not work [CODE] GetSystemTime(&t); char time[60] = ""; char y[20],mon[20],d[20],h[20],min[20],s[20]; sprintf(y, "%d", t.wYear); sprintf(d, "%d", t.wDay); sprintf(mon, "%d", t.wMonth); sprintf(h, "%d", t.wHour+5); sprintf(min, "%d", t.wMinute); sprintf(s, …

Member Avatar for Ancient Dragon
0
444
Member Avatar for mitrious

My book asked me to create a simple version of a list that held strings. Here's what I did. [CODE]class String_list{ public: typedef std::string* iterator; typedef std::string* const_iterator; typedef size_t size_type; String_list(){ data = limit = 0; }; String_list(size_type, std::string); size_type size() const{return limit - data;}; bool empty() {return data …

Member Avatar for vijayan121
0
673
Member Avatar for Tinee

I am making a program to calculate the distance between 2 location by inputting the latitude and longitude of the locations using DMS, then convert the given DMS to angular measurement. I have made the program using functions but when it finally calculate for the distance, it always goes to …

Member Avatar for Dingbats
0
222
Member Avatar for chirag_mittal

Hello friends, I need some help with my c++ hangman code.The code is below. [code] /*Game of Hangman Author - Chirag Mittal */ #include<iostream.h> // For input/output #include<fstream.h> // For file input/output #include<string.h> // For strcpy #include<time.h> // For time #include<stdlib.h> #include<ctype.h> //for toupper & tolower #define MAX_WORD_SIZE 15 // …

Member Avatar for chirag_mittal
0
1K
Member Avatar for chirag_mittal

Hello, I am need of urgent help.I've made a program to generate bills (using goto statements) but my teacher has asked me to remove those and use something else in place of it.The problem is that I have tried using separate functions for that (It's not working properly) and I'm …

Member Avatar for chirag_mittal
0
231
Member Avatar for CanaznFTW

Still learning in programming and this problem is course related. Although I am not asking for the answer I would appreciate some help and if anyone can point out what I might be doing wrong that would be awesome. I was able to find other articles addressing the matter although …

Member Avatar for CanaznFTW
0
404
Member Avatar for user543820

Hello! I want to split a mathematical expression 3 + 4 ( 5 * 8 ) into tokens by using space as a splitting mode. e.g 3 + 4 ( 5 and so on. But when I write string exp; char space[]=" "; result=strtok(exp,space); the compiler gives the error at …

Member Avatar for Ancient Dragon
0
173
Member Avatar for FrancisLazo

I am troubled by my very long code for a movie reservation program. A friend of mine told me that I can shorten my very long code using functions. What made my code very long is the switch statement that I used which is composed of 200 cases. Sorry because …

Member Avatar for Red Goose
0
223
Member Avatar for Labdabeta

Hello, I have decided to make a timer program on my computer to limit the amount of time that I game. Anyways, I have it working fine with a small borderless window in the top left of the screen that ticks down and when it gets to 0 it sounds …

Member Avatar for Labdabeta
0
7K
Member Avatar for thisischris

so the user enters a string of coordinates like "(1,2) (3,4) (5,6) etc..." and I'm trying to use istringstream to pull out each number and put it into an integer value. This is what I've got so far: [CODE] string S1, temp; int num1=0, tempX, tempY; cin.ignore(15,'\n'); getline(cin,S1); num1=S1.find("("); S1.erase(S1.begin(),S1.begin()+num1+1); …

Member Avatar for thisischris
0
209
Member Avatar for axeves

The exception is: Unhandled exception at 0x6474f269 in Loliboll.exe: 0xC0000005: Access violation reading location 0x0000000c. I think it's a memory leak. I tried to solve it obviously, but to no prevail. This is the code: [CODE]#include "stdafx.h" using namespace std; int main() { // FreeConsole(); int a; // INTRO = …

Member Avatar for template<>
0
135
Member Avatar for Kelikmalok

I am supposed to make a palindrome program using stacks, but my function keeps returning false. Here's the code: Main: [CODE]int main() { char word[50]; cin >> word; cout << strlen(word); if (checkIfPalindrome(word) == true) { cout << endl << "Is a palindrome."; } else { cout << endl << …

Member Avatar for arkoenig
0
150
Member Avatar for semccarthy

Hi, I'm currently designing a software application for teaching, it will have a large backend database, short animation videos(basic 2d of people talkin). I'm just looking for some advice in what is the best language to code this type of project in. I have done several projects in both java …

Member Avatar for semccarthy
0
755
Member Avatar for rogba

Does anybody know if C++ programming:program Design including Data Structures, by D.S. MALIK has an Instructor's edition??

Member Avatar for JamieLynnSEO
0
72
Member Avatar for PerplexedWon

Problem I am experiencing: When I compile my code, I get these two error codes: 1) In file included from C:\Users\PaulWilliams\Desktop\CSci Work\C++ Programming\TestScores.cpp 2) unterminated #ifndef I am not understanding what I did wrong, I have done all of my header files the same way and never had this problem. …

Member Avatar for PerplexedWon
0
198
Member Avatar for TimBob12

Hi there, I am fairly new to C++ and wanted to have a go at coding my own function with parameters. However some of the parameters are arrays and I get strange errors occur. I will comment my code with a couple of other questions as well. I am writing …

Member Avatar for TimBob12
0
200
Member Avatar for uhangkincai

Hi all, my nick name is uhangkincai, 5 years symbian developer for mobile application with symbian native (symbian c++). i join this forum to get new knowledge and also to find any project about symbian c++. thanks and regards,

Member Avatar for AndreRet
0
76
Member Avatar for honeythigh

hello, i am a newbie who doesn't have any programming experience. i heard that python is great to start with, but i prefer to begin with c++ because it's known as the best for game programming. 1) is it okay to learn c++ for a newbie? 2) is c++ really …

Member Avatar for honeythigh
0
407
Member Avatar for francisp94

I'm kind of new to C++ and this forum so forgive me if i look dumb. :icon_cheesygrin: So my program is basically knowing what category is the book inside the "input.txt" using the Dewey Decimal System and displays it in "output.txt It's working fine at the moment. But now it …

Member Avatar for francisp94
0
136
Member Avatar for vjackcon

The End.