"C" Programming Language - ANSI C

Started by sivaji, Jan 10, 2008, 06:58 PM

Previous topic - Next topic

sivaji

Programming Stuffs in "C" - Technical Skills for INTERVIEW

ANSI C

1: I'm trying to use the ANSI ``stringizing'' preprocessing operator # to insert the value of a symbolic constant into a message, but it keeps stringizing the macro's name rather than its value.

This is because "3" is not a legal integral constant in C - it's a string constant.

2: I don't understand why I can't use const values in initializers and array dimensions, as in
   const int n = 7;
   int a[n];

Because you're not using C++.

3: What's the difference between ``char const *p'' and ``char * const p''?

One `` '' character. There are some trivial differences having to do with the distinction between a pointer to a constant, and a constant pointer, but since you can cast either to a (char *) it hardly matters.

4: Why does the ANSI Standard not guarantee more than six monocase characters of external identifier significance?

Because none of the members of the committee had names over six letters, or in which letters other than the first were capitalized.

5: What is the difference between memcpy and memmove?

memmove moves memory, and memcpy copies it. memmove may not be supported on machines without internal robot arms. Do not use memmove while the machine is powered up - you can destroy your memory.

6: What are #pragmas and what are they good for?

They are useful ways to eliminate compiler features which are not helpful to your goals; contrast #utility, which introduces useful compiler features, and #absolutist, which introduces those compiler features believed to be right. #relativist is supported by some compilers.

7: What does ``#pragma once'' mean? I found it in some header files.

It means that your program will only run once; it's used to create ``crippled demos''.

8: Is C an acronym?

Yes, it stands for ``C''. It's another of those funky recursive acronyms.
Am now @ Chennai