No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
i am writing a function to convert fractions to intgers for example: .636 -> 636 or .45 -> 45 [CODE] int ret_int(double input) { while(true) { // this line is for debugging only cout << input << " " << floor(input) << endl; if(input == floor(input)) return input; input = … |
|
I wrote a template function that converts any numerical value to string : [code] template <class T> string ConverttoS(T input) { std::stringstream out; out << input ; return out.str(); } [/code] now i want to use this template function inside a class , but if i did so i would … |
|
Hi everybody, i was writing a small c++ class that uses a list as a data member , i then wrote a small print function to print the numbers in the list [code] #include <iostream> #include <string> #include <sstream> #include <list> using namespace std; class A { private: list<int> number; … |