- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
7 Posted Topics
Well, i'm not eating or drinking anything right now, but i'll have a glass of milk before sleep.
you can use 'number % 10' to find out the last digit of number. and you can loop finding out how many digits are there in the number. then just keep using '%' and '/' to find out the first and last digit of the number and compare, and split …
I want to compose a Matrix class template. Matrix objects need to copy data very often, such as in copy constructor or assignment operator overload function, so it need to be efficient. For most cases, I should not escape the assignment operator overload function of each data item, but for …
use static_cast to convert base class pointer to derived class pointer is allowed but not safe. you can use reinterpret_cast if you guarantee this operation to be safe, it is usually faster than static_cast. you may use dynamic_cast to make it converted at runtime.
Just remember to include the file which you are trying to use is declared in it. For example, if you use Class A in x.cpp, include the header file where the Class A is declared. This principle also fit for function declarations. However, for global variables, if you need to …
I guess you can try std::setfill('-') for the last question. It is declared in <iomanip> Or you can just use loop to generate '-'.
leading zeros should be omitted in normal cases i think
The End.
deltamaster