how to build software with optimization
Friday, October 30, 2020
constexpr concepts
constexpr concepts
- Constants and Constant Expressions in C++11
- Application of C++11 User-Defined Literals to Handling Scientific Quantities, Number Representation and String Manipulation
- Constant expressions
- constexpr specifier (since C++11)
- constexpr (C++)
- Understanding constexpr specifier in C++
- Difference between `constexpr` and `const`
Thursday, October 29, 2020
copy constructor vs assignment operator
research: copy constructor vs assignment operator
- Constructors (C++)
- Copy Constructors and Copy Assignment Operators (C++)
- Automatics, Copy Constructor, Assignment Operator
- Copy constructor vs assignment operator in C++
- Copy assignment operator
- Copy constructor vs assignment operator in C++
- What's the difference between assignment operator and copy constructor?
- Difference Between Copy Constructor and Assignment Operator in C++
- Copy Constructors and Assignment Operators
top post
good reference
smart pointer in C++
smart pointer in C++
unique_ptr, auto_ptr,shared_ptr,weak_ptr
- Using std::unique_ptr (RAII) with malloc() and free()
- Variable Declaration and Initialization
- shared_ptr Polymorphic Magic Pitfall
- The A::Restricted Idiom
- Memory Management and RAII
- Smart Pointers Gotchas
- The C++ Standard Library, 2nd
- isual Studio Slow Debugging and _NO_DEBUG_HEAP
- Robust C++: Initialization and Restarts
- Dangling Pointers: Pathology, Prevention and Cure
- Ten C++11 Features Every C++ Developer Should Use
- Modernizing Legacy C++ Code
- Articles by Marius Bancila (Articles: 27, Technical Blogs: 9)
- The Most Essential C++ Advice
- Object Oriented Programming with C++
- Move Semantics and Perfect Forwarding in C++11
- What's New in Visual Studio 2013 for Native Development
- What's New in VS11 for Native Development
- Articles by Marius Bancila (Articles: 27, Technical Blogs: 9)
- Smart pointers for single owners and their aliases
- Preparing to Know Modern C++
- std::unique_ptr
- std::unique_ptr
- How to: Create and use unique_ptr instances
- Introduction of Smart Pointers in C++ and It’s Types
- auto_ptr, unique_ptr, shared_ptr and weak_ptr
- Dangling, Void , Null and Wild Pointers
- void pointer in C / C++
- NULL pointer in C
- The Smart Pointer That Makes Your C++ Applications Safer - std::unique_ptr
- How to declare std::unique_ptr and what is the use of it?
-
What is the difference between #include
and #include “filename”? -
What is a smart pointer and when should I use one?
- smarter pointer
how to update legacy c code?
how to use smarter pointer?
Monday, October 26, 2020
C++ string and operations
C++ string and operations
- How to return a string class from a C++ function/method
- A new approach to memory management that solves the issues with shared_ptrs
- Ideas from a smart pointer(part 2). size == sizeof(std::shared_ptr)/2
- std::string class in C++
- C++ string class and its applications
- C++ Strings
- C++ Pointers
- C++ Standard Library: The string Class
- C++ String Class
- std::basic_string
- basic_string Class
- String Objects: The string class library
- std::string - the C++ String Class
- C++ String Class
- C-Style Strings
- C++ string class
- MODULE 25 C++ STRING CLASS PROGRAM EXAMPLES 1
- MODULE 25_1 C++ STRING CLASS TYPES AND CODE SAMPLES 2
- MODULE 25a C++ STRING CLASS PROGRAMMING 3
- MODULE 25b C++ STRING CLASS EXAMPLES 4
- MODULE 26 THE C++ STRING CLASS CODE EXAMPLES 5
- MODULE 26a C++ PROGRAM SAMPLES ON STRING CLASS 6
- MODULE 26a_1 C++ STRING CLASS CODE EXAMPLES 7
- .::Tenouk's C & C++ Site Index::.
- C LAB WORKSHEET 4 C main() and printf() functions 1
- C LAB WORKSHEET 4_1 C main() and printf() functions 2
- C LAB WORKSHEET 5 C/C++ Variable, Operator And Type 1
- C LAB WORKSHEET 5_1 C/C++ Variable, Operator And Type 2
- C LAB WORKSHEET 5_2 C/C++ Variable, Operator And Type 3
- C LAB WORKSHEET 6 C scanf(), scanf_s() family 1
- C LAB WORKSHEET 6_1 C scanf(), scanf_s() Examples & Exercises 2
- C LAB WORKSHEET 6_2 C scanf(), scanf_s() Exercises 3
- C LAB WORKSHEET 11 C & C++ Pointers Part 1: Playing With Memory Addresses
- C LAB WORKSHEET 11a C & C++ Pointers Part 2: Pointers, Array and Functions
- C LAB WORKSHEET 11a_1 C & C++ Pointers Part 3: Pointers, Array and Functions
- THE C LAB WORKSHEETS/EXERCISES/ACTIVITIES
- MODULE X USING C LIBRARY - THE C CHARACTER AND STRING 1
- MODULE Xa USING C LIBRARY - THE C CHARACTER AND STRING 2
- MODULE Xb USING C LIBRARY - THE C CHARACTER AND STRING 3 --------------------------------------------------------------------------
Tenouk C/C++ site
scanf and printf function examples
Sunday, October 25, 2020
permutation group
permutation group
- Permutation
- Permutation group
- Group Theory and Sage¶
- Permutation Cycle
- Cyclic permutation
- §26.13 Permutations: Cycle Notation
- Math 412. Symmetric Group: Answers.
- Permutation Groups
- Permutation Groups
- Permutation Groups: Basics
- Cycles and Cycle Structure
- Math 403 Chapter 5 Permutation Groups:
- Permutation Groups
- 5 Permutations and Orbits
- Chapter 5:: The Symmetric Group
- 5:: Permutation Groups
- 5. Permutation groups
- Lecture Notes: group theory
- 1. groups
- Abstract Algebra: Theory and Applications
- Download Annual Edition
good explanation:)
good explanation:)
MIT lecture notes
FFT library and techniques
FFT library and techniques
- FFTW website
- High-performance multi-dimensional C++ Array class (as fast as Fortran)
- FFTW++: Fast Fourier Transform C++ Header/MPI Transpose for FFTW3
- Computing FFT and IFFT with FFTW library C++
- FFTW++: Fast Fourier Transform C++ Header/MPI Transpose for FFTW3
- fftw++
- Windows Installation Notes
- Downloading FFTW
- Dd1vanov / Simple-FFT
- C++ Tutorial: Computing the 1-D FFT using the FFTW library on Ubuntu/Linux
- C++ Tutorial: 1-D FFT and IFFT with the FFTW library and Visual Studio on Windows
- C++ Tutorial: Writing an fftShift function for the FFTW library
- FFT properties demonstration
- But what is the Fourier Transform? A visual introduction.
- Intuitive Understanding of the Fourier Transform and FFTs
- Fourier Transform, Fourier Series, and frequency spectrum
- FFT Tutorial
- iscrete Fourier Transform - Simple Step by Step
- The FFT Algorithm - Simple Step by Step
Building FFTW 3.x under Visual C++/Intel compilers
Important: If you want to compile FFTW as a DLL, you should add a line #define FFTW_DLL to fftw3.h and ifftw.h before compiling. This will add the requisite __declspec decorations to function declarations etc.
Project files to compile FFTW 3.3 with Visual Studio 2010 were sent to us by Long To: fftw-3.3-libs-visual-studio-2010.zip.
Saturday, October 24, 2020
std::cerr vs std::clog
std::cerr vs std::clog
- I/O Redirection in C++
- C++ Basic Input/Output
- What is the difference between cout, cerr, clog of iostream header in c++? When to use which one?
- std::cerr, std::wcerr
- C++ cerr
- std::cerr | Error Stream Object in C++ with Examples
- What is C++ Standard Error Stream (cerr)?
- C++ Basic Input/Output: Cout, Cin, Cerr Example
- Write std::cerr to txt file
The cerr object in C++ is an object of class ostream. It is associated with the standard C error output stream stderr.
#pragma directive in C++
#pragma directive in C++
- Compiler Warning (level 1) C4068
- #pragma
- Use of #pragma in C
- C/C++ #include directive with Examples
- #pragma Directive in C/C++
- Draw an ellipse divided by straight line into two colored part in C++ Graphics
- Speed up Code executions with help of Pragma in C/C++
- Pragma directives and the __pragma keyword
- cin get() in C++ with Examples
- Cin-Cout vs Scanf-Printf
- How to use getline() in C++ when there are blank lines in input?
- Difference between cin and cin.get() for char array
unknown pragma
The compiler ignored an unrecognized pragma. Be sure the pragma is allowed by the compiler you are using. The following sample generates C4068:
It is of two types #pragma startup, #pragma exit and #pragma warn.
#pragma startup allows us to specify functions called upon program startup.
#pragma exit allows us to specify functions called upon program exit.
#pragma warn tells the computer to suppress any warning or not.
cin.get() is used for accessing character array. It includes white space characters. Generally, cin with an extraction operator (>>) terminates when whitespace is found. However, cin.get() reads a string with the whitespace.
statistics and numerical recipe in C++
statistics and numerical recipe in C++
- C++ programs for Finance
- siren0413 / OptionPricingFormular_CD
- Robert Davies
- Matrix Documentation
- A User-Friendly C# Descriptive Statistic Class
- Numerical Recipes Home Page
- Mathemathics Framework
- Inner Product Experiment: C# vs. C/C++
I have made some programs for common uses in finance. They may be of interest to others, so I have made them public under the GNU Public Licence .
C++ Financial Algoritms (Financial Numerical Recipes)
In finance, there are areas where formulas tend to get involved. Sometimes it may be easier to follow an exact computer routine. I have made some C++ subroutines that implements common algoritms in finance. Typical examples are option/derivatives pricing, term structure calculations, mean variance analysis. These routines are presented together with a good deal of explanations and examples of use, but it is by no means a complete "book" with all the answers and explanations. I'm hoping to turn it into a book, but even in its incomplete state is should provide a good deal of useful algorithms for people working within the field of finance. The manuscript and codes will be added to as I get the time. All the code should conform to the current ANSI C++ standard.
plan to convert it to C++. a good exercise, adding GUI is another option with MFC chart.
Wednesday, October 21, 2020
C# Couldn't process file xxx.resx due to its being in the Internet or Restricted zone or having the mark of the web on the file
C# Couldn't process file xxx.resx due to its being in the Internet or Restricted zone or having the mark of the web on the file
- C# Couldn't process file xxx.resx due to its being in the Internet or Restricted zone or having the mark of the web on the file
- Couldn't process file resx due to its being in the Internet or Restricted zone or having the mark of the web on the file
- Cannot process file because of mark of the web error in Visual C# project
- Remove the Mark of the Web: Visual Studio 2019 Build Error
Matrix class in C/C++ and other operations
Matrix class in C/C++ and other operations
- Matrix Library in C
- QR decomposition
- A C++ Matrix Class
- MathLibrary for Matrix and Vector
- Solve Linear and Polynomial Equations
- A matrix class with serialization and advanced input/output functions
- BOOK:: C Interfaces and Implementations
- drh/cii
- google download site
- Recommended Books
- Articles by john morrison leon (Articles: 10)
- An examination of menus from a beginner's point of view
- Scrollbars, using the WS_HSCROLL and WS_VSCROLL styles
- MFC Document/View documentation and enhancements
- Getting BN_DOUBLECLICK to Work for Buttons
- Space and Matrix Transformations - Building a 3D Engine
- Least Squares: A Matrix Approach in Java
-
Applying Matrix Transformations in GDI+
- C++ Include test: full matrix
- Top 5 Beautiful C++ std Algorithms Examples
- Debug/Release Numerical Differences
- x86/x64 Library Numerical differences
- 64-bit programs and floating-point calculations
- Accelerating Debug Runs, Part 1: _NO_DEBUG_HEAP
- Visual Studio Slow Debugging and _NO_DEBUG_HEAP
- Smart Pointers Gotchas
- Learning Basic Math Used In 3D Graphics Engines
matrix class implementation in C/C++
in comment section, there is one good comment from Danelle in Italy on how to free memory.
it has implementation in C++, new Matrix class.
BOOK:: C Interfaces and Implementations
This hierarchy contains all the source code from my book
"C Interfaces and Implementations: Techniques for Creating Reusable
Software (Addison-Wesley Professional Computing Series, 1997,
ISBN 0-201-49841-3).
For installation instructions, see install.html.
MFC tricks related with matrix
Tuesday, October 20, 2020
LNK4075 ignoring '/EDITANDCONTINUE' due to '/SAFESEH' specification
LNK4075 ignoring '/EDITANDCONTINUE' due to '/SAFESEH' specification
- LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification
- How to fix Visual Studio C++ Warning: LINK4075
- Supported Code Changes (C++)
- Supported Code Changes and Limitations (C++)
- LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification
- /SAFESEH disables Edit and Continue? RRS feed
- Warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/SAFESEH' specification
- #visual studio compilation # warning LNK4075: ignoring '/ EDITANDCONTINUE' due to '/ SAFESEH' specification
good posts with personal thoughts and understanding
42 You can either have "Edit and continue" support or optimizations. Usually, you put "Edit and continue" on debug builds, and optimizations on release builds. Edit and continue allows you to change code while you are debugging and just keep the program running. It's not supported if the code also has to be optimized.
It's a documentation bug, I annotated the MSDN article. It makes sense, /SAFESEH generates stack unwinding info in a table rather than using the stack. That's incompatible with Edit+Continue's need to move code around into empty spots of the image, it's not smart enough to update the table.
The workaround is simple, /SAFESEH makes no sense in the debug build. Only use that linker option in the Release build.
Like Hans Passant pointed out, the option to turn SAFESEH off is project properties >> Configuration Properties >> Linker >> Advanced. The last option there 'Image Has Safe Exception handlers'
Warning D9035 option 'Gm' has been deprecated and will be removed in a future release LargeNumber
whewn I compile a legacy project and ran into this warning:
Warning D9035 option 'Gm' has been deprecated and will be removed in a future release LargeNumber
- Command line warning D9035: option 'Gm' has been deprecated and will be removed in a future release
Try selecting
I had the same problem using Visual Studio 2019, in the end the problem was in a second project I had in the same solution, that had the option set to Yes (/Gm).
Monday, October 19, 2020
copy constructor and move semantics in C++
copy constructor and move semantics in C++
- C++ Explained: Object initialization and assignment, lvalues and rvalues, copy and move semantics and the copy-and-swap idiom
- C++11 Move Semantics, rvalue Reference
- Inside C++ – Class, Struct and Objects
- C++11 Constructors and Copy Assignment – Part 2
- C++ Class Hierarchies Crash Course: Derivation (“is-a”) vs Composition (“has-a”), and Is a Square a Rectangle?
- C++: Polymorphic cloning and the CRTP (Curiously Recurring Template Pattern)
- C++ Copy Constructor in depth
- Copy Constructors and Assignment Operators: Just Tell Me the Rules!
- Explicit Constructor in C++
How to convert a std::string to const char* or char*?
How to convert a std::string to const char* or char*?
print hex code of char or string in C++
print hex code of char or string in C++
- ASCII Text to Hex Code Converter
- ASCII Table and Description
- how do I print an unsigned char as hex in c++ using ostream?
- Formatting Cout Output in C++ using iomanip
- How to print unsigned char[] as HEX in C++?
- Display char as Hexadecimal String in C++
- Print unsigned char array in c
- Working with Hexadecimal values in C programming language
- StringStream in C++ for Decimal to Hexadecimal and back
- C++ - Working with characters and text
you can type a string and see the text code in hex quickly.
it has a good program to do this. need to use it in future..
Saturday, October 17, 2020
size of class or object in C++
size of class or object in C++
- Size of C++ classes
- how to determine sizeof class with virtual functions?
- Determining the Size of a Class Object
- Object
- sizeof operator
- Why is the size of an empty class not zero in C++?
- How do I calculate size of a simple class in C++?
- Size of a C++ class object
- Size of a class in C++ | Padding, alignment in class | Size of derived class
Firstly, while in C++ there are member functions, static data members. Do those have any contribution to the size of the class, objects?
The answer is no. Only the non-static data members contribute to the size of class and objects. This is because static members have only one instance which is shared among all objects. And normal member functions are like executable code which does not have size like data members.
Friday, October 16, 2020
deep understanding of OOP concepts and __CPUID macro
deep understanding of OOP concepts and __CPUID macro. from a nerd:)
- __cpuid, __cpuidex
- djkaty / Il2CppInspector
- C++ Explained: Object initialization and assignment, lvalues and rvalues, copy and move semantics and the copy-and-swap idiom
- How to determine programmatically whether your application and OS are 32 or 64-bit
- Printing numbers in binary format in C++
- How to determine programmatically if your processor has hyperthreading, SIMD and other processing capabilities with __cpuid
- Tutorial: How To Fix WMI Corruption
- Visual Studio 2012 – Day 1 Annoyances (with an emphasis on C++)
- C++ Class Hierarchies Crash Course: Derivation (“is-a”) vs Composition (“has-a”), and Is a Square a Rectangle?
- C++ Class Hierarchies Crash Course: Derivation (“is-a”) vs Composition (“has-a”), and Is a Square a Rectangle?
While a looping solution still has applicability in some other languages, there is a much more elegant way to do it in C++ that is often overlooked:
int v = 0x12345678;
std::cout << std::bitset<32>(v);
#include header file : bitset
mathematics related topics
keyword: squar root in cp.com
- Drawing a Line Graph in GDI+
- Basics of Signing and Verifying code
- DataPlotter - linear or logarithmic display of 2D data
- Linear and Logarithmic Display of 2D Data, An Enhancement
- Segmented Linear Regression
- Sparse Array Template Class
- A Real Polynomial Class with Root Finder
- Linear Equation Solver in C++
- Square Root algorithm for C
- Numerical Methods with C++ Part 3: Root Approximation Algorithms
- A Short Introduction into IEEE 754 Floating-Point Model
- Numerical Methods in C++ Part 1: Newton-Cotes Integration
- Ben1980 / numericalIntegration
- Numerical Methods in C++ Part 2: Gauss-Legendre Integration
- loguru documentation
- Introduction into Logging with Loguru
- Least Mean Square Algorithm (using C++)
- SR2JLIB - A Symbolic Regression Library for Java
- Natural Logarithms and Exponent
- Microcontrollers & CORDIC Methods
- Fast stepwise rotation
- Perspective Projection of a Rectangle (Homography)
- Natural Logarithms and Exponent
- Microcontrollers & CORDIC Methods
- Natural Logarithms and Exponent
- Natural Logarithms and Expone
- Calculate exp() and log() Without Multiplications
very good transformation way...
Thursday, October 15, 2020
basic data type of C++
basic data type of C++
- Print character through ASCII value using cout in C++
- 4.11 — Chars
- “C++ int to char*” Code Answer
- 4.12 — Literals
- std::dec, std::hex, std::oct
- std::oct , std::dec and std::hex in C++
- C++ cout hex values?
- Input/output manipulators
- String literals
- Integer literals
- Floating point literal
- Types of Literals in C/C++ with Examples
- What's the C++ suffix for long double literals?
- C - Constants and Literals
- C Floating-Point Constants
- Floating-point literals
- C library function - strlen()
- C++ Standard Library headers
- Fundamental types
- Built-in types (C++)
- An expression statement. (For more information, see Expressions.)
- The left operand of the comma operator. (For more information, see Comma Operator.)
- The second or third operand of the conditional operator (? :). (For more information, see Expressions with the Conditional Operator.)
- Comma Operator: ,
- Sequential-Evaluation Operator
- Conditional Operator: ? :
- ODULE 2 C AND C++ PROGRAM CONSTRUCT AND BASIC DATA TYPES 1
- MODULE 2_1 C AND C++ CONSTRUCTS AND BASIC DATA TYPES 2
- MODULE 2a MORE ON C/C++ CONSTRUCTS AND BASIC DATA TYPES 3
- MODULE 2b FINAL PART C/C++ CONSTRUCTS AND BASIC DATA TYPES 4
- How to enter the value of EOF in the terminal
- C LAB WORKSHEET 6 C scanf(), scanf_s() family 1
- C LAB WORKSHEET 6_1 C scanf(), scanf_s() Examples & Exercises 2
- C LAB WORKSHEET 6_2 C scanf(), scanf_s() Exercises 3
- C LAB WORKSHEET 5_2 C/C++ Variable, Operator And Type 3
- C LAB WORKSHEET 5_1 C/C++ Variable, Operator And Type 2
- C LAB WORKSHEET 5 C/C++ Variable, Operator And Type 1
suffix, if present, is one of f, F, l, or L. The suffix determines the type of the floating-point literal:
(no suffix) defines double
f F defines float
l L defines long double
Built-in types (also called fundamental types) are specified by the C++ language standard and are built into the compiler. Built-in types aren't defined in any header file. Built-in types are divided into three main categories: integral, floating-point, and void. Integral types represent whole numbers. Floating-point types can specify values that may have fractional parts. Most built-in types are treated as distinct types by the compiler. However, some types are synonyms, or treated as equivalent types by the compiler.
Void type
The void type describes an empty set of values. No variable of type void can be specified. The void type is used primarily to declare functions that return no values or to declare generic pointers to untyped or arbitrarily typed data. Any expression can be explicitly converted or cast to type void. However, such expressions are restricted to the following uses:
Wednesday, October 14, 2020
C++ operator precedence table
C++ operator precedence table
- C++ Operator Precedence and Associativity
- Operators Precedence in C++
- C++ Operator Precedence
- Explicit type conversion
- Increment/decrement operators
- C Operator Precedence
- C++ built-in operators, precedence, and associativity
- C++ Operator Precedence
- C/C++ Reference
- C++ Operator Precedence
- cpp-built-in-operators-precedence-and-associativity.md
- C Operator Precedence Table :: PDF
- Operators in C and C++:: Wikipedia
- Operators Precedence in C++
- Operator Precedence and Associativity in C
- C++ Operator Precedence
- Operator precedence and associativity::IBM
- Examples of expressions and precedence
- Compound literal expressions
- new expressions (C++ only)
- delete expressions (C++ only)
- Reference collapsing (C++11)
- 5.1 — Operator precedence and associativity
- 2.1 Operators and Operands
- C++ Operator Precedence
- C++ Operator Precedence Chart (highest on top)
Also, multiple operators can have the same level of precedence (as we can see from the above table). When multiple operators of the same precedence level are used in an expression, they are evaluated according to their associativity.
int a = 1;
int b = 4;
b += a -= 6;
Table
For the purposes of these tables, a, b, and c represent valid values (literals, values from variables, or return value), object names, or lvalues, as appropriate. R, S and T stand for any type(s), and K for a class type or enumerated type.
Operator precedence determines which operator is performed first in an expression with more than one operators with different precedence.
IBM knowledge
Tuesday, October 13, 2020
how to configure : _cplusplus macro variables in Visual Studio 2017
_cplusplus macro in Visual Studio 2017. how to use it?
- Predefined macros
- /Zc (Conformance)
- /permissive- (Standards conformance)
- /Zc:__cplusplus (Enable updated __cplusplus macro)
- /std (Specify Language Standard Version)
- Open the project's Property Pages dialog box. For details, see Set C++ compiler and build properties in Visual Studio.
- Select Configuration Properties, C/C++, Language.
- In C++ Language Standard (or for C, C Language Standard), choose the language standard to support from the dropdown control, then choose OK or Apply to save your changes.
- Microsoft C++ language conformance table
- Mouse and KeyBoard Hooking utility with VC++
- /Zp (Struct Member Alignment)
- Linker options
- Some Handy Visual C++ Pre-Processor Macros
- The Lost Art of Structure Packing
- Objects and alignment
The Microsoft C/C++ compiler (MSVC) predefines certain preprocessor macros, depending on the language (C or C++), the compilation target, and the chosen compiler options.
MSVC supports the predefined preprocessor macros required by the ANSI/ISO C99, C11, and C17 standards, and the ISO C++14 and C++17 standards. The implementation also supports several more Microsoft-specific preprocessor macros. Some macros are defined only for specific build environments or compiler options. Except where noted, the macros are defined throughout a translation unit as if they were specified as /D compiler option arguments. When defined, the macros are expanded to the specified values by the preprocessor before compilation. The predefined macros take no arguments and can't be redefined.
You can use the /Zc compiler options to specify standard or Microsoft-specific compiler behavior.
Syntax /Zc:option{,option}
Specify standards conformance mode to the compiler. Use this option to help you identify and fix conformance issues in your code, to make it both more correct and more portable.
To set this compiler option in the Visual Studio development environment
In Visual Studio 2017 version 15.5 and later versions, use this procedure:
Open your project's Property Pages dialog box.
Select the Configuration Properties > C/C++ > Language property page.
Change the Conformance mode property value to Yes (/permissive-). Choose OK or Apply to save your changes.
In versions before Visual Studio 2017 version 15.5, use this procedure:
Open your project's Property Pages dialog box.
Select the Configuration Properties > C/C++ > Command Line property page.
Enter the /permissive- compiler option in the Additional Options box. Choose OK or Apply to save your changes.
The /Zc:__cplusplus compiler option enables the __cplusplus preprocessor macro to report an updated value for recent C++ language standards support. By default, Visual Studio always returns the value "199711L" for the __cplusplus preprocessor macro.
Syntax /Zc:__cplusplus[-]
Enable supported C and C++ language features from the specified version of the C or C++ language standard.
Syntax
/std:c++14
/std:c++17
/std:c++latest
/std:c11
/std:c17
By default, when code is compiled as C, the MSVC compiler doesn't conform to a particular C standard. It implements ANSI C89 with several Microsoft extensions, some of which are part of ISO C99. Some Microsoft extensions can be disabled by using the /Za compiler option, but others remain in effect. It isn't possible to specify strict C89 conformance.
Starting in Visual Studio 2019 version 16.8, you may specify /std:c11 or /std:c17 for code compiled as C. These options specify conformance modes that correspond with ISO C11 and ISO C17. Because the new preprocessor is needed to support these standards, the /std:c11 and /std:c17 compiler options set the /Zc:preprocessor option automatically. If you want to use the traditional (legacy) preprocessor for C11 or C17, you must set the /Zc:preprocessor- compiler option explicitly. Setting the /Zc:preprocessor- option may lead to unexpected behavior, and isn't recommended.
Since C17 is largely a bug fix release of ISO C11, MSVC support for C11 already includes all the relevant defect reports. At present, there are no differences between the C11 and C17 versions except for the __STDC_VERSION__ macro. It expands to 201112L for C11, and 201710L for C17.
To set this compiler option in the Visual Studio development environment
it has good code snippet:
6 #ifdef __cplusplus
7 extern "C" {
8 #endif // __cplusplus
9 #define LIBSPEC __declspec(dllexport
11 LIBSPEC BOOL InstallKeyBoardHook(HWND hWndParent);
12 LIBSPEC BOOL UnInstallKeyBoardHook(HWND hWndParent);
13 #undef LIBSPEC
14
15 #define UWM_KEYBOARD_MSG ("UWM_KEYBOARD_USER_MSG")
16 #ifdef __cplusplus
17 }
18 #endif // __cplusplus
Controls how the members of a structure are packed into memory and specifies the same packing for all structures in a module.
Syntax
/Zp[1|2|4|8|16]
Monday, October 12, 2020
C++ tips and C++ exit() function
C++ exit() function
- Partial C/C++ Function List
- decoding * and inc/dec operator combos like *++p , *p-- ,etc
- C and C++ Programming Tips
- exit()
- Partial C/C++ Function List
Prototype: void exit(int ExitCode);
Header File: stdlib.h (C) or cstdlib (C++)
Explanation: Exit ends the program. The ExitCode is returned to the operating system, similar to returning a value to int main.
A note about C vs. C++ Note that header files from the C standard library should have the form headername.h when used in a C program, and the form cheadername when used in C++ programs (note the c as a prefix). For instance, in a C program the stdlib header file would be included as follows
tips and tricks on MFC controls
tips and tricks on MFC controls
- Application Information and Management
- icrosoft Visual C++/ MFC
- The Values of a Windows Control
- Lines
- GDI Topics: Polylines
- GDI Topics: Polygons
- GDI Topics: Rectangles
- Bézier Curves
- The GDI Coordinate Systems
- Wizard Pages
When you write an application, you create a single CWinApp-derived object. At times, you may want to get information about this object from outside the CWinApp-derived object. Or you may need access to other global "manager" objects.
The Microsoft Foundation Class Library provides the following global functions to help you accomplish these tasks:
Saturday, October 10, 2020
Error C2664 'Employee::Employee(const Employee &)': cannot convert argument 1 from 'const char [4]' to 'char *'
used function_name(char*,char*) to define strings. later on in main(), assign them with literals such as "Bob", "Robert" , then get this error.
Error C2664 'Employee::Employee(const Employee &)': cannot convert argument 1 from 'const char [4]' to 'char *'
- C++ cannot convert parameter 1 from 'const char *' to 'char *'
- Cannot convert argument 1 from 'const wchar_t [16]' to 'LPTSTR'
- error C2664 cannot convert argument 1 from 'const char [11]' to 'LPSTR'
- Disable Conformance Mode (easiest) : tested
- Cast to a char* : tested
- Define as non const: ?
- Make function take const arguments : tested such as const char*...
- Compiler Error C2664
You have some options:
it has many good examples and need to browse when got time...
If a temporary object is passed to a function that takes a reference to an object as a parameter, that reference must be a const reference.
If the function is passed a parameter that is not of the type that the function expects, a temporary object is created by using the appropriate constructor. This temporary object is then passed to the function. In this case, the temporary object is used to initialize the reference. In earlier versions of the language, all references could be initialized by temporary objects.
To fix C2664, 1. Recheck the prototype for the given function and correct the argument noted in the error message. 2. Supply an explicit conversion if necessary.
Friday, October 9, 2020
mathematical exercises
mathematical exercises
- Gauss Newton for Zener
- Array-less Numerical Spiral Pattern
- Encrypt and Decrypt using 2x2 Hill Cipher
- Random extraction of 5 cards from a deck
- Parsing a postfix expression in C#, my naive approach
- Boosting ODE simulations with Boost.odeint and Boost.SIMD
- Solving ordinary differential equations in C++
- Odeint is a modern C++ library for numerically solving Ordinary Differential Equations.
- odeint v2 - Solving ordinary differential equations in C++
- Solving ordinary differential equations in C++
Tuesday, October 6, 2020
const function in C++
const keyword after function header..
- Initializers
- extern (C++):: microsoft
- 8.10 — Const class objects and member functions
- Const member functions in C++
- When a function is declared as const, it can be called on any type of object, const object as well as non-const objects.
- Whenever an object is declared as const, it needs to be initialized at the time of declaration. however, the object initialization while declaring is possible only with the help of constructors.
- const (C++)
- Const member functions in C++ :: already tested
- Meaning of 'const' last in a function declaration of a class?
- What is meant with “const” at end of function declaration? [duplicate]
- const (computer programming)
- The C++ 'const' Declaration: Why & How
- 8.9 — Class code and header files
- 8.8 — The hidden “this” pointer
- 8.7 — Destructors
- 8.6 — Overlapping and delegating constructors
- Const Correctness
- C++ keywords: const
take a look:)
Like member functions and member function arguments, the objects of a class can also be declared as const. an object declared as const cannot be modified and hence, can invoke only const member functions as these functions ensure not to modify the object.
A const object can be created by prefixing the const keyword to the object declaration. Any attempt to change the data member of const objects results in a compile-time error.
Syntax: const Class_Name Object_name;
A function becomes const when the const keyword is used in the function’s declaration. The idea of const functions is not to allow them to modify the object on which they are called. It is recommended the practice to make as many functions const as possible so that accidental changes to objects are avoided.
const member functions Declaring a member function with the const keyword specifies that the function is a "read-only" function that does not modify the object for which it is called. A constant member function cannot modify any non-static data members or call any member functions that aren't constant.To declare a constant member function, place the const keyword after the closing parenthesis of the argument list.
The const keyword is required in both the declaration and the definition.
The const member functions are the functions which are declared as constant in the program. The object called by these functions cannot be modified. It is recommended to use const keyword so that accidental changes to object are avoided.
A const member function can be called by any type of object. Non-const functions can be called by non-const objects only.
Warning :: LNK4075 ignoring '/EDITANDCONTINUE' due to '/SAFESEH' specification
another warning message when I compile legacy project:
Warning LNK4075 ignoring '/EDITANDCONTINUE' due to '/SAFESEH' specification
- Warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/SAFESEH' specification
- warning LNK4075: ignoring '/ EDITANDCONTINUE' due to '/ SAFESEH' specification
- VS2015 cannot use edit and continue and warning LNK4075 solution
- LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification
- Supported Code Changes and Limitations (C++)
- Supported Code Changes (C++)
- Edit and Continue (Visual C++)
- VS2019:: Edit and Continue (C++)
- /SAFESEH disables Edit and Continue?
- Visual Studio 2012 compilation error [warning C4996: 'scanf': This function or variable may be unsafe. 】 solution
Warning D9035 option 'Gm' has been deprecated and will be removed in a future release
when I compile a legacy project in VC++ 2017, I ran into this message and take note here:
Warning D9035 option 'Gm' has been deprecated and will be removed in a future release
- Command line warning D9035: option 'Gm' has been deprecated and will be removed in a future release
- /Gm (Enable Minimal Rebuild)
Try selecting
I had the same problem using Visual Studio 2019, in the end the problem was in a second project I had in the same solution, that had the option set to Yes (/Gm).
Deprecated. Enables minimal rebuild, which determines whether C++ source files that include changed C++ class definitions (stored in header (.h) files) need to be recompiled.
/Gm is deprecated. It may not trigger a build for certain kinds of header file changes. You may safely remove this option from your projects. To improve build times, we recommend you use precompiled headers and incremental and parallel build options instead. For a list of deprecated compiler options, see the Deprecated and Removed Compiler Options section in Compiler Options Listed by Category.
Monday, October 5, 2020
big guys' paper list --- floppy disk tricks
big guys' paper list
- How to read and write old floppy disks
- ATTACHING 5.25″ FLOPPIES VIA USB
- Device Side Data - USB Adapter/Controller for 5.25" Floppy Disk Drive Review
- How to play old-style 5.25 inch floppy disk games on a modern PC, using the FC5025!
- Sabrent USB 3.0 to SSD/SATA/IDE 2.5/3.5/5.25-INCH Hard Drive Converter with UL Power Supply & LED Activity Lights [10TB Support] (USB-DS12)
- Articles by #realJSOP (Articles: 69, Tip/Tricks: 84)
- Articles by Michael Haephrati (Articles: 45, Tip/Tricks: 2)
- Articles by Marc Clifton (Articles: 239, Project: 1, Tip/Tricks: 5)
- Tracking The Mouse In A View
- Capturing the Mouse
- Global Mouse and Keyboard Library
- Mouse Events
- Create your Own Runtime Movable Windows Forms Controls
- A Decimal Class Implementation
- A Simple Moving Average Algorithm
- Disable MFC SDI/MDI Submenu
- List of _MSC_VER and _MSC_FULL_VER
Visual Studio version and discrimination macros
research on UUID topics
ater got these UUIDs, then need to come up with a key to protect my software..
- Machine Finger Print - The Right and Efficient Way
- How to Get the BIOS UUID
- Creating a Unique String Using a UUID
- Developing RPC Windows Applications
- How to solve Link Error on call to ::UuidToString()?
- Compiler cannot find .lib file
- rpc.h linking issue
- Create a Windows Service Application Using the Boost.Application Library
- Searching for a Reliable Hardware ID
- Searching for a Reliable Hardware ID
- denisbrodbeck / machineid
- The Best Way To Uniquely Identify A Windows Machine
- The Best Way To Uniquely Identify A Windows Machine
- How to uniquely identify windows machine
Protecting your work - use the right way to identify your client machine
Get a unique identifier for a computer The BIOS UUID is a unique number tied to the motherboard and if you changed your motherboard, you can safely say you changed your computer. From my point of view, it is a better method of identifying your hardware and, as I'll show you in this tip, it is very easy to implement.
A small function to either accept or create a UUID* and return a CString
You will have to #include rpcdce.h into your code and link rpcrt4.lib into your program in order for this to work. If you don't have either of these files, download the latest *release* version of the Platform SDK. I've taken the liberty of showing you the contents of the two files I created to make it a little simpler. If you create a CPP and an H file, and then copy/paste these two sections into the approriate files, you won't have to do anything other than adding the files to your project (and installing the SDK of course), and then doing a build.
When you want to use the functions included in rpc.h, you can use two ways like as follows:
1. Click Project -> Properties -> Linker -> General -> Additional Library Directories, add the directorie of Rpcrt4.lib to this box, the Rpcrt4.lib always locate in the path: %Program Files%\Microsoft SDKs\Windows\v6.0A\Lib; and then, add Rpcrt4.lib to Linker-> Input ->Additional Dependences. In your program, just use "#include
2. Just use the following code in your program:
#include
on my laptop, it is located at :C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib
machineid provides support for reading the unique machine id of most host OS's (without admin privileges)
1. Cross-Platform (tested on Win7+, Debian 8+, Ubuntu 14.04+, OS X 10.6+, FreeBSD 11+) 2. No admin privileges required 3. Hardware independent (no usage of MAC, BIOS or CPU — those are too unreliable, especially in a VM environment) 4. IDs are unique1 to the installed OS
Function: ID() (string, error) Returns original machine id as a string.
Function: ProtectedID(appID string) (string, error) Returns hashed version of the machine ID as a string. The hash is generated in a cryptographically secure way, using a fixed, application-specific key (calculates HMAC-SHA256 of the app ID, keyed by the machine ID).
What you get This package returns the OS native machine UUID/GUID, which the OS uses for internal needs. All machine IDs are usually generated during system installation and stay constant for all subsequent boots. The following sources are used:
Windows uses the MachineGuid from HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography
Unique Key Reliability Do note, that machine-id and MachineGuid can be changed by root/admin, although that may not come without cost (broken system services and more). Most IDs won't be regenerated by the OS, when you clone/image/restore a particular OS installation. This is a well known issue with cloned windows installs (not using the official sysprep tools).
A machine ID uniquely identifies the host. Therefore it should be considered "confidential", and must not be exposed in untrusted environments. If you need a stable unique identifier for your app, do not use the machine ID directly.
A reliable solution is to hash the machine ID in a cryptographically secure way, using a fixed, application-specific key.
That way the ID will be properly unique, and derived in a constant way from the machine ID but there will be no way to retrieve the original machine ID from the application-specific one.
On Windows:
reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography /v MachineGuid
or
Open Windows Registry via regedit Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography Take value of key MachineGuid
wmic csproduct get UUID
wmic bios get name,serialnumber,version
wmic cpu get name,CurrentClockSpeed,MaxClockSpeed
wmic cpu get name,CurrentClockSpeed,MaxClockSpeed /every:1
get-wmiobject Win32_ComputerSystemProduct | Select-Object -ExpandProperty UUID