C / C++
Diverse
Kompilera C++-källkod (.cpp-filer) i Visual Studio Developer Command Prompt:
cl /EHsc filename.cpp
(Generar filename.exe)
Bjarne Stroustrup's homepage
C++11 FAQ (stroustrup.com)
cplusplus.com
Microsoft C++ Team Blog
cplusplus.com/reference/
cplusplus.com/reference/cstdio/
cplusplus.com/reference/cstdio/printf/
Windows Data Types
TCHAR (VS macro):
A WCHAR if UNICODE is defined, a CHAR otherwise.
This type is declared in WinNT.h as follows:
#ifdef UNICODE
typedef WCHAR TCHAR;
#else
typedef char TCHAR;
#endif
How to add additional libraries to Visual Studio project?
Add #pragma comment(lib, "Your library name here") to your source.
visual studio c++ external dependencies
Do a ctrl+shift+f and search for #include "f.h" and see if that exists anywhere in your solution.
If you drop the .h from <string.h> and use <string> you will get the C++ string class header instead. The C++ replacement for <string.h> is <cstring>.
Adding files in external dependencies
I don't understand the point in explicitly adding the headers to the External Dependencies folder - if your code really depends
on those headers, then they will be #included somewhere in your code - and that will automatically create the dependency. If, OTOH,
those headers aren't used anyway, then I see no point in "faking" an unnecessary dependency.
Get Started with Win32 and C++
Working with Strings
GDI+
Module 1. Your First Windows Program
Drawing a Line (GDI+)
Drawing a String (GDI+)
Using Windows
Window Functions
Window Styles
Message-Box Styles
WIN32 API Messagebox buttons return values
CreateWindow (CreateWindowA macro)
CreateWindowExA function
CreateWindowExW function
Windows and Messages
Windows Controls
Windows API controls I
Control Library
About Static Controls
Static Control Styles
WM_NOTIFY message
Windows.h C++ Tutorial 2: Adding Static Text to Your Window
TN003: Mapping of Windows Handles to Objects
Handles and Objects
WIN32 API - Set visibility mode for windows
Example 3: Call the Win32 API
Win32 Functions
Using Timers
Win32 Predefined Symbols
Using the Windows Headers
Remove the Close window option
Guide to WIN32 Paint for Beginners
How to Create a Button
C++ Win32 GUI Making a button with events
Windows.h C++ Tutorial 4: Preforming Button Actions
Windows.h C++ Tutorial 6: Alerting the User With a Beep and a Popup Window (Message Box)
BN_CLICKED notification code
Assigning a control id to a win32 button
How to Create a Multiline Edit Control
Create a "hello world" app in C++ (Windows 10) (Universal Windows Platform, XAML)
Code Page Identifiers
cpluplus.com
Basic Input/output
C++ Language Tutorial
Arrays
Character sequences
Pointers
C++ Tutorial
Getting Started with Microsoft Visual Studio 2010, 2012 and 2013 using C++ Tutorial
Initializing Variables (C++ programming)?
Assigning text to variables in C++
std::getline (basic_string)
std::string::empty
std::wstring
std::vector
std::vector::vector
C++ Vector Tutorial
How do I find the length of an array?
std::wstring VS std::string
How to check if a std::string is set or not?
Use std::string with Win32 API?
Why switch statement cannot be applied on strings?
Evaluate a string with a switch in C++ [duplicate]
Switch on Strings in C++
STL Maps -- Associative Arrays
Malloc
Visual C++ Team Blog
C/C++ extension for Visual Studio Code
C/C++ for Visual Studio Code (Visual Studio Marketplace)
Writing secure code
Buffer Overflow Attack Explained with a C Program Example
Secure Coding in C and C++: Strings and Buffer Overflows
C++ WCHAR manipulations
Working with Strings
LoadString function
how to output the wchar_t type string
swprintf
Text and Strings in Visual C++ (Visual Studio 2015)
What are TCHAR, WCHAR, LPSTR, LPWSTR, LPCTSTR (etc.)?
C++ WCHAR manipulations
What are TCHAR, WCHAR, LPSTR, LPWSTR, LPCTSTR (etc.)?
Making Win32 Application work on ANSI & UNICODE
In UNICODE, TCHAR is WCHAR. In not UNICODE, TCHAR is CHAR.
Data Conversion
Convert std::string to WCHAR ?
Simple way to convert from a WCHAR to a string?
itoa, _itoa, ltoa, _ltoa, ultoa, _ultoa, _i64toa, _ui64toa, _itow, _ltow, _ultow, _i64tow, _ui64tow (Visual Studio 2017)
_itoa_s, _ltoa_s, _ultoa_s, _i64toa_s, _ui64toa_s, _itow_s, _ltow_s, _ultow_s, _i64tow_s, _ui64tow_s (Visual Studio 2017)
C++ / WIN32 API - Int string conversion
How do I turn off Unicode in a VC++ project?
DWORD is a typedef for, as you mentioned, 'double word' sized integers. It's a way of sizing them,
rather than giving bit numbers. In general:
8 bit = BYTE
16 bit = WORD
32 bit = DWORD
64 bit = QWORD (quad-word).
They are useful, because that way you know you have, for example, 32 bits worth of space to store information in. On the other hand, just using int means that you might have 32, but you could just as well only have 16 bits of data (depending on the compiler and target architecture).
EDIT: Actually, I just did some more reading and it turns out I was kind of wrong :)
See this: https://en.wikipedia.org/wiki/Word_(computer_architecture)
Basically, the gist of it is that a WORD is traditionally the size of a memory pointer, the 'most natural' size of data that can be read. DWORD is twice that size, QWORD is four times, etc.
Now, traditionally that would be 16 bits of data; a legacy to the 16 bit MSDOS days. Nowadays, though, it's generally 32 bit or 64 bit, according to your computer's architecture. So, really, a DWORD on modern computers should be 128 bit!
However, for 'backwards compatibility reasons', the size of each has stayed the same. So, the WORD type is 16 bits, even though it technically should be 64 bits, like a computer word.
TLDR; what I wrote above is technically correct, just not for the reasons I gave.
Also, I should have mentioned that typically you shouldn't use them; they're rather obscure and only really make sense to use if you're interfacing with the WinAPI.
'System' : a namespace with this name does not exist
https://stackoverflow.com/questions/213907/c-stdendl-vs-n
https://stackoverflow.com/questions/8311058/n-or-n-or-stdendl-to-stdcout
The only difference is that std::endl flushes the output buffer, and '\n' doesn't. If you don't want the buffer flushed frequently, use '\n'. If you do (for example, if you want to get all the output, and the program is unstable), use std::endl.
http://www.cplusplus.com/forum/beginner/21595/
When cin encounters an input it can't properly read in to the variable specified (such as inputing a character into an integer variable), it goes into an error state and leaves the input in it's buffer.
You have to do several things to properly handle this scenario.
1. You have to test for this error state.
2. You have to clear the error state.
3. You have to either alternatively handle the input data that generated the
error state, or flush it out and reprompt the user.
Windows Dev Center/Docs/Classic Desktop/Develop/Desktop technologies/System Services/Windows System Information/System Information/
System Information Reference/System Information Functions
System Information Functions
http://stackoverflow.com/questions/9616957/delay-execution-1-second
http://stackoverflow.com/questions/14818084/what-is-the-proper-include-for-the-function-sleep-in-c
https://linux.die.net/man/3/sleep
http://stackoverflow.com/questions/341817/is-there-a-replacement-for-unistd-h-for-windows-visual-c
https://cboard.cprogramming.com/cplusplus-programming/37862-delay-int-milliseconds-visual-cplusplus.html
https://stackoverflow.com/questions/158585/how-do-you-add-a-timed-delay-to-a-c-program
https://stackoverflow.com/questions/2252372/how-do-you-make-a-program-sleep-in-c-on-win-32
https://stackoverflow.com/questions/3379139/sleep-function-in-windows-using-c
SleepEx function
GetComputerName function
GetComputerNameEx function
MessageBox function
MessageBeep function
http://stackoverflow.com/questions/14915924/assigning-value-to-char-array
http://stackoverflow.com/questions/12160233/assigning-char-array-a-value-in-c
strcpy, wcscpy, _mbscpy
http://stackoverflow.com/questions/32136185/difference-between-strcpy-and-strcpy-s
http://stackoverflow.com/questions/9257665/difference-between-string-and-string-h
strcpy_s, wcscpy_s, _mbscpy_s
C++ Play Sound on Windows (console application)
https://social.msdn.microsoft.com/Forums/vstudio/en-US/be7cbb75-f98a-4351-a4b9-9610c1f47647/play-a-sound-in-c?forum=vcgeneral
https://stackoverflow.com/questions/19894384/simple-sounds-in-c
https://stackoverflow.com/questions/22253074/how-to-play-or-open-mp3-or-wav-sound-file-in-c-program
https://stackoverflow.com/questions/13998642/error1error-lnk1104-cannot-open-file-winmm-lib
https://docs.microsoft.com/sv-se/windows/desktop/FileIO/creating-and-using-a-temporary-file
https://docs.microsoft.com/sv-se/windows/desktop/api/fileapi/nf-fileapi-gettemppatha