Skip to main content

Posts

Showing posts from August 31, 2018

C++ sizeof Operator

    #include <iostream> using namespace std ; int main () { cout << "Size of char : " << sizeof ( char ) << endl ; cout << "Size of int : " << sizeof ( int ) << endl ; cout << "Size of short int : " << sizeof ( short int ) << endl ; cout << "Size of long int : " << sizeof ( long int ) << endl ; cout << "Size of float : " << sizeof ( float ) << endl ; cout << "Size of double : " << sizeof ( double ) << endl ; cout << "Size of wchar_t : " << sizeof ( wchar_t ) << endl ; return 0 ; }     command sizeof ( ***** )       output

what is difference between signed integers and unsigned integers

  difference between signed integers and unsigned integers         A signed integer is one with either a plus or minus sign in front. That is it can be either positive or negative. An unsigned integer is assumed to be positive . This is important in computing because the numbers are stored (usually) as a fixed number of binary digits. For a signed integer one bit is used to indicate the sign - 1 for negative, zero for positive. Thus a 16 bit signed integer only has 15 bits for data whereas a 16 bit unsigned integer has all 16 bits available. This means unsigned integers can have a value twice as high as signed integers (but only positive values). On 16 bit computers this was significant, since it translates to the difference between a maximum value of ~32,000 or ~65,000. On 32 bit computers its far less signifocant since we get 2 billion or 4 billion. And on 64 bit computers it becomes of academic interest.    

File "./setup.py", line 4, in from setuptools import setup ModuleNotFoundError: No module named 'setuptools'

Traceback (most recent call last):   File "./setup.py", line 4, in <module>     from setuptools import setup ModuleNotFoundError: No module named 'setuptools' FIX- Distribute has been merged with setuptools 0.7, so just get setuptools for both Python 2.7 and 3.x To install this on Debian: sudo apt - get install python - setuptools For Python 3.x sudo apt - get install python3 - setuptools       If you have Python 2 >=2.7.9 or Python 3 >=3.4 installed from python.org, you will already have pip and setuptools, but will need to upgrade to the latest version: On Linux or OS X: pip install - U pip setuptools On Windows: python - m pip install - U pip setuptools