No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Re:
if I wanted to do for example this [CODE]class MyClass{ float x,y; void SomeFunction() }; void MyClass::SomeFunction(){ MyClass A = this;//???? } [/CODE] How would I do that? I have virtually no experience with pointers so please help me out. I basically want to make the new class I am … |
|
Re:
Ok, I've been working on this for about 4 hours, but I cannot get it to work! I'm starting with a char, then I need it to become a const char so I can use strcmp in my if statements. If there's anything wrong in that idea, please tell me … |
|
Re:
I'm writing a simple program that reads a text file and counts the vowels in it and outputs how many are included. With the code I have I keep getting the wrong number of vowels outputted. Can anyone see where I made a mistake, I can't figure it out. my … |
|
Re:
Hi, I've got a problem with a program that boils down to strange behavior by the vector container class. It seems to not want to call constructors enough but calls destructors too many times: [CODE] #include <vector> #include <iostream> using std::cout; int constructor_count=1,destructor_count=1; class obj{public: obj(){ cout<<"C: "<<constructor_count++<<'\n'; } ~obj(){ … |
|
Re:
Here is the simplest program: [CODE]#include <iostream> using namespace std; int main() { cout << "hello" << endl; cin.get(); return 0; }[/CODE] When I ran it (using Dev C++), there is no output, just a blank screen. The problem seems to be from the "endl". If I delete it, or … |
|
Re:
I just saw someone's program that assigned string this way: [CODE]string x("snow");[/CODE] It seems to work, as I could display the output x as "snow". Is this a legible way to assign strings? How does it differ from [CODE]string x="snow";[/CODE] ? |
|
Re:
Hello People, I just came across this code as I was browsing through some C++ problem sets. This code gives compile time error but I am unable to understand the reason. I am C guy and my knowledge about C++ is not that great. So pardon if there is an … |
|
Re:
Hello people, I have two classes everyone with private data. I want only one function from each class to access private data from another class. I have checked "friend" function but It needs the class object as an argument. That is making things complicated on my side and I have … |
|
Re:
Hey I am pretty new to c++ and algorithmic , so please try explaining me what to do or give me a code for example don't redirect me to a site that already made a library for this because you only wasted your time telling me that. For example i … |