49,761 Topics
| |
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 … | |
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 … | |
[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] = … | |
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 … | |
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 … | |
what is accessor and mutator ?? and what is overloading of accessor and mutator?? Plz explain... | |
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 … | |
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 … | |
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 … | |
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. | |
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? | |
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 … | |
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 … | |
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 … | |
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, … | |
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 … | |
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...!! | |
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?? | |
| |
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, … | |
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 … | |
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 … | |
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 … | |
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, … | |
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 … | |
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 … | |
(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 … | |
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 … | |
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: … | |
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 … |
The End.