/*#ifndef _stdafx_h#define _stdafx_h#include //cin cout#include //malloc Free#include //strcpy#include //exit ()#endif*/
(1) Content: Write two lines at the beginning of the header file (StdAfx.h):
#ifndef _stdafx_h
#define _STDAFX_H//is typically
When you use the VC menu to add a class, you will find that the automatically generated code is always like the following:
# If! Defined (afx_xxxx1_included _)
# Define afx_xxxx1_encoded _
Code
# Endif
This is to prevent the header file from being
Common methods to prevent header files from being included multiple times in C ++ include:
1) Use the # ifndef... # define... # endif macro
# Ifndef _ myheader_h __# DEFINE _ myheader_h __
// Here is my class...
# Endif
2) use # pragma
Alternative syntax in PHP (colon, endif, endwhile, endfor), endwhileendforWe often see many strange PHP syntaxes In the templates of blog programs such as wordpress, such as: Empty For a considerable number of PHP enthusiasts, what are these
: This article mainly introduces PHP: Colon, endif, endwhile, and endfor. For more information about PHP tutorials, see. We often see many strange PHP syntaxes in the templates of wordpress blog programs, such:
[Php] view plaincopy
# If 0 ......... # endif can be used to block large sections of Code . However, you must note this when using it.
// Add By wogo at 2009-03-12 // retailmsg (1, (text ("deal with hevinterrupt @@@!!! :/R/N "); # If 0 cevents = (* pkeybdist->
What are the colons, endif, Endwhile, endfor in PHP, endwhileendfor
We often see a lot of strange php syntax in the wordpress template of a blog program, such as:
The empty
For a lot of PHP enthusiasts have never seen Ah, what are these things?
Alternative syntax in PHP (colon, endif, endwhile, endfor) we often see many strange PHP syntaxes in the templates of blog programs such as wordpress, such as: & lt ;? Php & nbsp; if (empty ($ _ GET [a]):? & Gt; & nbsp; & lt; fontcolor & quot; red &
Role: To prevent the header file from being repeatedly referencedBenefits: Improves compilation efficiency and avoids errors caused by duplicate definitions (if global variables are defined in the header file).Semantics:#ifndef a_h: "If not define A.
We all know that to prevent header files from being # include multiple times, we usually add the above mechanism to the header files, such as temp. h.
# Ifndef _ temp_h
# DEFINE _ temp_h
......
# Endif
In this way, the header file will only be
We often see a lot of strange php syntax in a WordPress-Class blog program template, such as: Empty PHP endif;? > For a considerable part of the PHP enthusiasts have never seen, what is these things? Are those blogging developers doing their own
A classic example
The most classic example of using preprocessing and macro definition is to add a header file to avoid the header file being compiled twice. In this case, there is a file headerfile. h. It is included in headerfile1.h and also
1. # difference between define and typedef
# Define is generally used to define constants and statement macro definitions and act as macro replacement during compilation. Of course, you can also complete a small part of the typedef function.
1. Do not ignore # ifndef in the header. This is a key thing. For example, you have two C files, both of which include the same header file. During compilation, these two C files need to be compiled into a runable file together, so the problem
Original file timesynmanager. h
# Ifndef timesynmanager_h __# Define timesynmanager_h __
Const int max_year = 1100;Const int min_year = 70;Typedef long _ int64;
# Include # Include # Include # Include # Include // # Include
Typedef/* _
Description of use of colon, endif, endwhile, and endfor in PHP. We often see many strange PHP syntaxes in the templates of wordpress blog programs. for example, copy the code as follows :? Phpif (empty ($ GET _ [a]):? Fontcolorred empty f we often
One, do not overlook the #ifndef in the first piece, this is a very important thing. For example, you have two C files, all two C files include the same head file. At compile time, the two C files will be compiled together into a running file, so
When I was a beginner in. net, I usually write Conditional compilation like this:
Code
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> /// /// Not recommended Conditional
Alternative syntax in PHP (colon, endif, Endwhile, ENDfor)
We often see a lot of strange php syntax in a wordpress-like blog program template, such as:
Empty of
For a considerable part of the PHP enthusiasts have never seen, what are these things?
We often see a lot of strange php syntax in the wordpress template of a blog program, such as: Empty For a lot of PHP enthusiasts have never seen Ah, what are these things? Are those blog developers doing their own php-like template
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.