49,761 Topics

Member Avatar for
Member Avatar for lewashby

The book I'm using continues to give me code and fails to explain the syntax. I got to a chapter on operator overloading and it gave me some code but didn't actually explain any of the code. I having trouble understanding the Rectangle operator+ line and that methods contents. Why …

Member Avatar for lewashby
0
191
Member Avatar for Elixir42

Hi 'Wise & Wonderful Daniwebbers', Why do I keep loosing my project settings when I add a new project to an existing solution? I have to go to every project, in the solution and re-configure each project's: * Include Directories; * Library Directories; * Linker Settings; etc., Which of the …

0
145
Member Avatar for preet4fun

[CODE]#include <iostream> #include <iomanip> #include <string> #include <cctype> #include <cstring> using namespace std; const int NUMROWS = 14; const int NUMSEATS = 7; //enum seatsType {A,B,C,D,E,F}; void initPlane(char plane[NUMROWS][NUMSEATS]) { int x,y; //strcpy(plane[2], "Row 1"); plane[0][0] = ' '; plane[0][1] = 'A'; plane[0][2] = 'B'; plane[0][3] = 'C'; plane[0][4] = …

Member Avatar for Gozo Anne
0
9K
Member Avatar for Đăng

my teacher asked me "Why c++/c## support operator overloading and java don't?" I have an answer for Java. anything I read, just said about how to write, define or something else. No answer for "why" someone can give me a document which I need or the answer. thanks for reading …

Member Avatar for mike_2000_17
0
424
Member Avatar for DS9596

Is this a good pseudocode and can you help me write this, I am kind of new to programming. if (choice > 0 && choice < 4) //choice is between 0 and 4 { cout << "Enter the distance: \n"; //displays the distance cin >> distance; //prints the distance if …

Member Avatar for rubberman
-1
442
Member Avatar for Gunjan_1

what is accessor and mutator ?? and what is overloading of accessor and mutator?? Plz explain...

Member Avatar for NathanOliver
0
60
Member Avatar for hAbbas

hi! i am trying to write a program that takes a long integer and compares every pair in that integer and displays largest pair. e.g we have an integer 23812 and in this integer largest pair is 81. so program should display 81. but i have no logic in mind …

Member Avatar for cheryllocascio
0
195
Member Avatar for murnesty

I have a type casting question. I saw method 2 in my code and it able to compile (The code is not written by me). Can I know what method2 mean? method 1 is understandable. class Base {}; class Derived : Base {}; void main () { //let say I …

Member Avatar for Olyboy16
0
152
Member Avatar for SuperCucumber

Helloo everybody, I'm in the midst of attempting to create a publisher-subscriber design. What i understand is that a publisher-subscriber pattern will mainly include distributing messages to certain subscribers at certain times. I was thinking there would be a "publisher" class & a "subscriber" class and later on publisher will …

Member Avatar for cheryllocascio
0
192
Member Avatar for maotopapakarabo.ramanaledi

Write a program that reads a line of text, changes each uppercase letter to the lowercase, and places in a queue and onto a stack. The program should then verify whether the line of text is a palindrome.

Member Avatar for DonnSchwartz
-1
175
Member Avatar for マーズ maazu

Greetings all, I use MinGW32 for doing problems and have reach a point where standard malloc() would throw bad_alloc() whenever i call new. What other alternatives for Windows in memory allocation?

Member Avatar for rubberman
0
1K
Member Avatar for HuePig

Hi, I'm having trouble reading a file the way I want it to. /*Textfile.txt*/ ROOM Closet Its too dark, you cant see anything. EXIT out Basement 1 ROOM Basement Its too dark, you need some sort of light to help you see. EXIT enter Closet 1 EXIT up Dinning_Room 1 …

Member Avatar for rubberman
0
122
Member Avatar for lewashby

What is the difference between these two classes? In the second one `protected:` looking like it isn't doing anything at all, there's nothing under it umbrella. class Tank { protected: int wheels; public: void setWheels(int newWheels) { wheels = newWheels; } int getWheels() { return wheels; } }; /////////////////////////////////////////////////////////////// class …

Member Avatar for lewashby
0
181
Member Avatar for HuePig

Hi, how can I store an object in a hash_map? I have an Item object and I want to pair it with a quantity. Will I be able to: 1. Find the item? 2. change the paired quantity? 3. sort it by qty or item name? /*Item.h handles the item …

Member Avatar for uonsin
0
392
Member Avatar for Jeroen Mathon

I keep getting coredumps when i run this function. void readUser(int uid) ///Reads users from data directory { std::stringstream fileName; fileName << "./data/" << uid << ".dat"; user myUser; std::cout << "USERNAME:" << myUser.name << "\n UID:" << myUser.uid; ///Reads data from file FILE* dat = fopen(fileName.str().c_str(),"rb"); fread(&myUser, sizeof(user), 1, …

Member Avatar for JasonHippy
0
180
Member Avatar for Jeroen Mathon

Hello, The reason why im asking for this is becouse im currently making a project that needs data storage. And sqlite seems to be perfect for that matter. I've already read the documentation of Sqlite3 but i found that insufficient. It didn't really explain much besides the obvious. I can …

Member Avatar for JasonHippy
0
565
Member Avatar for Gusani_1

Hello Friends, I want to know - "What is Polymorphism in C++?" Books can not help me...please make me clear about it..in simple terms..please...!!

Member Avatar for DonnSchwartz
0
211
Member Avatar for Sahilsikka

i want to know the differnce between int a=10 & int a; a=10; though both look same and assign the value 10 to the variable a. but in memory theres a big difference between te two. Can anyone help me with this??

Member Avatar for DonnSchwartz
0
193
Member Avatar for iamthwee
Member Avatar for lewashby

I'm reading my C++ book and I've come to a chapter on structures and unions. The book has tried to explain the difference but I'm not getting it's explanation. Playing with the structure examples in the book reminds me of accessing attributes to a python Class but apart from that, …

Member Avatar for cheryllocascio
0
189
Member Avatar for Tycellent

Hey everybody, As of this moment i'm trying to work out how to approach a state design. I've come across Source Makers' site [http://sourcemaking.com/design_patterns/state/cpp/1](http://sourcemaking.com/design_patterns/state/cpp/1) and am testing out the example. The program works fine when it's all in 1 file, although i had to change some stuff in main, but …

Member Avatar for rubberman
0
3K
Member Avatar for Saboor880

Hi! i am writing a program in which i am reading a text file named "studentinfo". I have made a notepad file as "studentinfo" and then wrote a program to read this file. but there is an error occuring : " invalid operand of types 'char[20]'and '<unknown type>' to binary …

Member Avatar for Saboor880
0
140
Member Avatar for HuePig

Hi, I have an Item class, how can I make my Item object be composed of more Item objects? Say I have a gun and its composed of more items like bullet and magazine, how can i make it do that? /*Item.h handles the item in game*/ #ifndef ITEM_H #define …

Member Avatar for HuePig
0
115
Member Avatar for amal.sultan.5855

In the Following code, Function Delete_item is not working properly. it only works when we use break; statement... if some can do it without using break; stetement then please share and eplain the method... #include<iostream> using namespace std; struct node {int info; node *link; }; class list {private: node *head, …

Member Avatar for cheryllocascio
0
412
Member Avatar for andrew mendonca

Define a C-string function void append(const char * v, const char * w, char * buffer) that appends the characters of C-string w to the characters of C-string v and stores the result in buffer. (Don't forget the terminating null character .) You can assume that the function is called …

Member Avatar for uonsin
0
402
Member Avatar for LucasMNF55

void password(){ string fpass; string pass; cout << "Type the password " << endl; getline(cin,pass); cin.ignore(); ifstream fin(FILENAME1); string str; getline(fin, str); fpass = str; cin.ignore(); if (pass.compare(fpass) == 0){ cout << " Hello!" << endl << endl; cout << "What do you want to do?" << endl; }else{ cout …

Member Avatar for LucasMNF55
0
265
Member Avatar for öahmut0047

(Practice) Determine a step-by-step procedure (list the steps) for each of the following tasks: Note: There’s no single correct answer for each task. This exercise is designed to give you practice in converting heuristic commands into equivalent algorithms and understanding the differences between the thought processes involved. 3The source code …

Member Avatar for NathanOliver
0
109
Member Avatar for manaog.aaronvici.7

2. (Practice) Determine a step-by-step procedure (list the steps) for each of the following tasks: Note: There’s no single correct answer for each task. This exercise is designed to give you practice in converting heuristic commands into equivalent algorithms and understanding the differences between the thought processes involved. 3The source …

Member Avatar for mattster
-1
345
Member Avatar for tentrabyte

Can anyone help me? my problem is that when i enter my full name it forcefully close. i don't know why. please help me with my problem #include <iostream> #include <string> using namespace std; string name, zodiac, horoscope; int age, month, day; cout<<"Enter your Full name: "; cin>>name; cout<<"Enter Age: …

Member Avatar for Sarkurd
0
2K
Member Avatar for myk45

Hi All, I run gdb server on a remote linux target and debug with the client. Are there some gui front-ends that might come in handy? I use gdb with --tui, but still sometimes find difficulty in "watch"ing variables. Is there some way i can perhaps use a gui based …

0
149

The End.