Friday, December 18, 2015

Getting Code::Blocks to work with std_lib_facilities.h

In Stroustrup's book, 'Programming: Principles and Practice Using C++', one must include the header file. This won't work in Code::Blocks without some modification.

First, go to settings→compiler→ and make sure 'Have g++ follow the C++11 ISO C++ language standard' is checked.

Then comment out or delete the following  in the std_lib_facilities.h as shown below:

#ifdef _MSC_VER
 // microsoft doesn't yet support C++11 inheriting constructors
 Vector() { }
 explicit Vector(size_type n) :std::vector<T>(n) {}
 Vector(size_type n, const T& v) :std::vector<T>(n,v) {}
 template <class I>
 Vector(I first, I last) : std::vector<T>(first, last) {}
 Vector(initializer_list<T> list) : std::vector<T>(list) {}
#else
 using std::vector<T>::vector; // inheriting constructor
#endif 

Source: http://www.cplusplus.com/forum/general/136389/

Friday, December 11, 2015

Stop Excel from changing cell contents

Highlight the column. Right-click → format cells → custom → then choose a single 0.

Source: http://stackoverflow.com/questions/2420931/stop-excel-from-changing-cell-contents-ever