No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
9 Posted Topics
Re: [CODE] class Myclass{ float x,y; void some_function(); }; void Myclass::some_function(){ Myclass* a = this; } [/CODE] | |
Re: [CODE] #include <iostream> #include <cmath> #include <string> using namespace std; int calculate(int,const char,int); int main() { using namespace std; int a,b; char operation[1]; cout << "Operations: +, -, *, /" << endl; cout << "Number 1: "; cin >> a; cout << "Operation: "; cin >> operation[1]; char op = … | |
Re: [QUOTE=e40thrilla;1143787]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: [QUOTE=cog_bn;1143704]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: Different generating style 1..call the generator 2..make a temp string object first,and the copy it to the left variable. Haha, is it right? | |
Re: [QUOTE=abhimanipal;1140797]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: [QUOTE=mitrmkar;1142828]Essentially a static member variable (be it of any type) is a variable that is common to all non-static instances of the class. Maybe the following explains it a bit .. [code] #include<iostream> using namespace std; // forward declaration class B; class A { // 'shared_value' is common to all … | |
Re: If the result is too big,it may overflow,because the variable has a fixed length. Exactly,you can use arrays to store every digit of the result,and at last,calculate the real value again |
The End.