- Upvotes Received
- 15
- Posts with Upvotes
- 12
- Upvoting Members
- 12
- Downvotes Received
- 3
- Posts with Downvotes
- 3
- Downvoting Members
- 3
A cat has 9 lives -- what has more than 9 lives? Answer: Frogs because they croak every night. (Duck Dynasty) |
|
Hey everyone, In addition to... Lazy Foo's Tutorial http://lazyfoo.net/tutorials/SDL/index.php "SDL Game Development" - Shaun Mitchell book are there any other recommended resources (does not have to be SDL) people could suggest? I've already created a console-based text adventure game and am really interested in expanding it into a text-adventure game … |
|
Hello. I have a few Qs about Hash tables. how does `std::hash` return a `std::size_t`? for example how does it convert a `std::string("Hello")` to `std::size_t`? How do these functions work? i have no idea what's `hash_combine` and `seed` do in `hashval.hpp` This is from STL 2nd edition. hashval.hpp #include <functional> … |
|
Hi It's been a while i'm learing C++ but still i have some issue with `Move semantics` and some other stuff. I wrote this class but i don't know why the `Copy constructor` is getting called and the output is a little strange to me, shouldn't the `Move Constructor` gets … |
|
In this game you need to give wierd reasons to ban who's on top. i will start: **I Ban you for looking at me!** |
|
I have some confusion about Copy Constructor. Why this program crashes if we remove Copy Constructor `MyString`? #include <iostream> #include <cstring> using namespace std; class MyString { private: char* Buffer; public: // constructor MyString(const char* InitialInput) { cout << "Default constructor: creating new MyString" << endl; if(InitialInput != NULL) { … |
|
I am using namespaces from a long time now. But, I don't know why we need them at the end? Why do I need to write using namespace std; OR std::string Why do we have to do this? Why have they made it this way? Can you elabroate this thing? … |
|
i write a code that coun t the number of upper case letter in a string there is a problem my code count space as capital letter code is below #include<iostream> #include<conio.h> #include<cstring> #include<string.h> using namespace std; class Letters{ private: char str[20]; int num; public: Letters(){ str[0]='\0'; num=0; } void … |
|
hi! i have written a code of linked list using character array to add and display data, it can add data but not display. can anyone help?? thanks. #include<iostream> using namespace std; class node private: char data[30]; node* next; public: char showdata() { return data[30]; } void setdata(char c[40]) { … |
|
Hi I have tried to implement Linked-List data structure and i was folowing a guide but i have an `error` in line 12 in `contactlist.h` I have included `contact.h` properly but still not working :-/ contact.h #ifndef CONTACT_H #define CONTACT_H #include <iostream> #include <string> #include "contactlist.h" class Contact { private: … |
|
can someone give me a detailed explaination why this won't compile, thanks` #include <iostream> using namespace std; int main () { int num1 = 5, num2 = 10; if (num1 < num2) { cout<<”num1 is less than num2”; else cout<<”num1 is not less than num2”; } return 0; } |
|
Solutions to quadratic equation Ax^2 +Bx+C=0 All solutions must be calculated in visual studio including the imaginary parts and using if statement |
|
So i've decided to use SFML and i'm just trying to figure out its advantages and disadvantages...I've looked around and this is what i've got so far. Advantages: * Cross Platform * OO Design * Simple and fast (subjective) Disadvantages: * Quite new Any additional thoughts will again appreciated |
|
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...!! |
|
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 I wrote a Singleton class but i got an error while controlling instantiation captain.h #ifndef CAPTAIN_H #define CAPTAIN_H #include <iostream> #include <string> class Captain { private: Captain(); Captain(const Captain&); Captain &operator=(const Captain&); std::string name; public: //Controll Instantiation static Captain &GetInstance(); //Set Name of the Captain std::string GetName(); //Get his/her … |
|
Define a function void order(int & a, int & b, int & c, bool ascending) that places the values in ascending or descending order, depending on whether the last parameter is true or false . For example, if x, y and z contain the values 3,1, and 2, respectively, then … |
|
Hello I use MinGW 4.8.2 and Qt IDE i tried to use `gprof`, I added the following flags QMAKE_CXXFLAGS_DEBUG += -pg QMAKE_LFLAGS_DEBUG += -pg to `.pro` file and extarcted the `gmon.out` file but i don't know how to convert it to a `.txt` file. the document say gprof options [executable-file … |
|
1. Create a class called Record that financial institute might use to represent their customer's record. This class should include one data member of type int to represent the account balance. Provide a constructor that receives an initial balance and uses it to initialize the data member. The constructor should … |
|
For this question, select and name a high-level language you will be discussing. Diagrams might help in your answers. a) Explain how the computer passes control to a subroutine (or procedure) and returns it to the main routine once the task has been completed. b) Explain, giving a relevant example, … |
|
hi. how can a decimal value be converted to binary in a c++ program? |
|
while loop or doo loop the output should be like this 1 12 123 1234 123 12 1 and 1234 123 12 1 12 123 1234 tnx |
|
Without using arrays, write a complete program that reads three integers from the console and outputs the same three numbers in ascending order on separate lines. For example if the input is 5 4 3 then the output will be 3 4 5. Do not prompt the user or produce … |
|
how can i download the c++ software, like turbo c can any one give me the link? |
|
Hello everyone!i'm new here and in c++ programming.I've wrote about 30 small programs and when i close the program and want it to run after, it compile well but when i'm waiting the answer, it comes and goes fast.i've tried to put cin >> a; as told me someone to … |
|
im using windows 7 64bit along with codeblocks and mingw and im trying to use non standard c++ libaries such as SDL , allegro and sfml but when i link them and try to compile the examples some work and some dont i wonder what i did wrong ? I … |
|
Hi what are Macros used for in C++? i never heard this word in my entire life :D and what are `assert()` and `NDEBUG`? |
|
Hi i tried to test some new features of C++ 11 but how come Visual Studio doesn't support `constexpr`? i tried this simple function but it won't compile constexpr int multiply(int x, int y) { return x * y; } |