C Interview Questions & Answers part 2

0
319

Q: – What are the stream files?

We can open file in C with using stream files.which are identified with a pointer to a FILE structure, or as low-level files, which are identified with an integer handle.

We can open stream files with using one of the following functions.

fopen(): Opens the specified file with the specified mode freopen(): Closes the file specified, then opens a new file as specified fdopen(): Opens a duplicate stream file for an already open low-level file

Q: – How do you remove a macro name?

By using the #undef directive with a macro name, that macro name can be removed, or “undefined.”

Q: – Why do you need the #endif directive?

The #endif directive is used with an #if, #ifdef, or #ifndef directives because statements under the control of a conditional preprocessor directive are not enclosed in braces ({ and }). Therefore, #endif must be used to mark the end of the block of statements.

Q: – How the processor registers can be used in C?

using keyword register we can use the process register in C.Basically process register is used to store variables those i want to access frequently.if these registers are not used in any other program,then those registers we used to allocate memory these variables.

Q: – Why do you need to use the typedef keyword?

By using the typedef keyword, you can define your own names to represent the data types in C.

Q: – Can you redirect a standard stream to a disk file?

Yes. With the help of the freopen() function, you can redirect a standard stream and associate the stream with a disk file.

Q: – Can the conditional expression following the #if directive be an arithmetic expression?

Yes

Q: – Is the C preprocessor part of the C compiler?

No

Q: – What is difference between visual c++ & ANSI c++ ?

Visual C++ is probably the most popular favored compiler, because of it's history of quality and stablity.But in ANSI C++ is a less popular, but is a much more powerful and robust compiler. The IDE is also a lot more powerful than MSVC.

Submitted By:-Rohit Kumar          Email-ID: – rohitkumar1372@yahoo.in

SHARE

LEAVE A REPLY