|
IT Placement Papers
3i-Infotech Placement Papers
Accenture Placement Papers
Infosys Placement Papers
Adobe Placement Papers
.........More
Technical Interview Questions
Networking Interview Questions
C Interview
Questions
.........More
Resume Guide for Jobseekers
Resume - Action words
Resume To-Do List
.........More
Soft Skills
Communication Skills
Leadership Skills
.........More
|
|
Covansys Placement Papers
7. Memory Allocation
7.1 Why doesn't the code ``char *answer; gets(answer);'' work?
7.2 I can't get strcat to work. I tried ``char *s3 = strcat(s1, s2);''
but I got strange results.
7.3 But the man page for strcat says that it takes two char *'s as
arguments. How am I supposed to know to allocate things?
7.5 I have a function that is supposed to return a string, but when it
returns to its caller, the returned string is garbage.
7.6 Why am I getting ``warning: assignment of pointer from integer
lacks a cast'' for calls to malloc?
:wq
7.7 Why does some code carefully cast the values returned by malloc to
the pointer type being allocated?
7.8 Why does so much code leave out the multiplication by sizeof(char)
when allocating strings?
7.14 I've heard that some operating systems don't actually allocate
malloc'ed memory until the program tries to use it. Is this legal?
7.16 I'm allocating a large array for some numeric work, but malloc is
acting strangely.
7.17 I've got 8 meg of memory in my PC. Why can I only seem to malloc
640K or so?
7.19 My program is crashing, apparently somewhere down inside malloc.
7.20 You can't use dynamically-allocated memory after you free it, can
you?
7.21 Why isn't a pointer null after calling free?
7.22 When I call malloc to allocate memory for a local pointer, do I
have to explicitly free it?
7.23 When I free a dynamically-allocated structure containing
pointers, do I have to free each subsidiary pointer first?
7.24 Must I free allocated memory before the program exits?
7.25 Why doesn't my program's memory usage go down when I free memory?
7.26 How does free know how many bytes to free?
7.27 So can I query the malloc package to find out how big an
allocated block is?
7.30 Is it legal to pass a null pointer as the first argument to
realloc?
7.31 What's the difference between calloc and malloc?
7.32 What is alloca and why is its use discouraged?
8. Characters and Strings
8.1 Why doesn't "strcat(string, '!');" work?
8.2 Why won't the test if(string == "value") correctly compare string
against the value?
- 8.3 Why can't I assign strings to character arrays?
8.6 How can I get the numeric (character set) value corresponding to a
character?
8.9 Why is sizeof('a') not 1?
9. Boolean Expressions and Variables
9.1 What is the right type to use for Boolean values in C?
9.2 What if a built-in logical or relational operator ``returns''
something other than 1?
9.3 Is if(p), where p is a pointer, valid?
10. C Preprocessor
10.2 I've got some cute
Page No :
1
2 3
Check
Aptitude Interview Questions
for more Aptitude Questions
Check
Placement Papers for more IT
Companies Paper
|