Monday, May 24, 2010

In C++ What is a statement that associates an indentifier with a object, a function, or data type...?

so that the programmer can refer to that item by name

In C++ What is a statement that associates an indentifier with a object, a function, or data type...?
a declaration





example:


int count; defines count as an integer
Reply:you can use #define


eg


#define IsWhiteSpace(c) ((c)==' '||(c)=='\t'|| \


(c)=='\r'||(c)=='\n')





...


...


while (IsWhiteSpace(*p))


p++;


...


...





or


#define CR 13


#define LF 10


#define ESC 27





or use typdef - very handy for creating named structures etc

online survey

No comments:

Post a Comment