Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 1.48 KB

File metadata and controls

25 lines (20 loc) · 1.48 KB
layout default
title New to Visual Studio
permalink /VisualStudio.htm

#Using #pragmas #pragmas are a way to help inform the compiler to complete actions while your program is being compiled. You can find out more about #pragmas here{:target="_blank"}.

##Using #pragmas in Visual Studio In Visual Studio we use #pragma once{:target="_blank"}. The intent of this #pragma is to allow for a file to only be included and compiled once.

While non standard in C, C++ and Wiring, it is quite common to use this #pragma over the standard #ifndef/#ifdef/#endif approach. Using #pragma allows the Visual Studio compiler to efficiently open/read/close the file if #pragma once is encountered over the standard approach. This allows compile time of your program/sketch to be improved.

#Precompiled Headers While a new concept to Wiring and Sketches, precompiled headers are common in C and C++ development{:target="_blank"}. They make compilation even more efficient than using #pragmas.

The default Wiring template creates a few files (stdafx.h and stdafx.cpp) in your project that are used to manage precompiled headers. You can find more info about these files here{:target="_blank"}. Please note that precompiled headers are disabled in our default projects to ensure source compatibility with Arduino Wiring.