C interview questions – page 12
2,130 questions. Tap “Show answer” to check yourself.
-
How much space is allocated by the expression " int *a[10]" if size of int is 4 and size of int pointer is 2
-
How to allocate memory for 2D array using malloc()?
-
What is :- pointer , NULL pointer , dangling pointer , far pointer , near pointer , huge pointer , generic pointer , smart pointer ?
-
Write a small C program, which while compiling takes another program from input terminal, and on running gives the result for the second program. (NOTE: The key is, think UNIX).
-
A C program that prints itself.
-
Main() { printf("%s",printf("samsung")+fun()); } fun() { return "electronic"; }
-
A string was given and its hash was computed
-
What is the difference between typedef and # define? Which is better? Explain #define INT1 int*; typedef int* INT2; INT1 id1, id2; INT2 it1, it2;
-
You're given the following program:
-
Using c-strings write a program that will analyse the text"1.1my brother is taller than me.1.2 I am a boy of sixteen years old". The program should remove multiple spaces betweem words,find the longest word in the text,search and identify the number o
-
What is the value of z?
-
How are global variables in different files are resolved.
- Advertisement
-
What is the value of y in the following code?
-
Give the output of the following program
-
API methods (a)file * getfiles(dir); (b) dir * getsubdirs(dir); were given, and 2 structures one representing file and other representing dir were given. It is provided that both the structures have many members but only the name field is kn...
-
What's the similarity between structures and union?
-
Is it possible to swap two variables without using a temporary variable? If yes how?
-
How many BOOMs will be printed ?
-
Convert this function to a macro.
-
Let Sample.exe is a C compiled and linked file. What is the argc value in Sample.c for following command line
-
Printf("""n""") prints n but printf(""n"") gives compile error
-
What is the size of struct xyz (in bytes) in the following:
-
Where do you initialize static class member variables?
-
What does the following function return?
- Advertisement
-
I have a 8 bit register ,in that each field having the some specific function. How to represent that in strutures by using the bit-fields.
-
Assume the following C variable declaration
-
How many time foo2() would get called given A<B 25% of the times and C<D 75% of the times and foo1() is called 5000 times
-
X = malloc (y). Which of the following statements is correct. a) x is the size of the memory allocated b) y points to the memory allocated c) x points to the memory allocated d) none of the above
-
Which is the valid declaration? a) #typedef struct { int i;}in; b) typedef struct in {int i;}; c) #typedef struct int {int i;}; d) typedef struct {int i;} in;
-
How do you write a C program which can calculate lines of code but not counting comments?