You are on page 1of 25

1.Difference between "C structure" and "C++ structure".

2.What will happen if I say delete this 3.What is Dangling pointer? 4. Difference between "C structure" and "C++ structure". 5. Diffrence between a "assignment operator" and a "copy constructor" 6. What is the difference between "overloading" and "overridding"? 7. Explain the need for "Virtual Destructor". 8. Can we have "Virtual Constructors"? 9. What is a COPY CONSTRUCTOR and when is it called (this is a frequent question !)? 10. Explain term POLIMORPHISM and give an example using eg. SHAPE object: If I have a base class SHAPE, how would I define DRAW methods for two objects CIRCLE and SQUARE. 11. What is the word you will use when defining a function in base class to allow this function to be a pol imorphic function? 12. What are 2 ways of exporting a function from a DLL? 13. You have two pairs: new() and delete() and another pair : alloc() and free(). Explain differences between eg. new() and malloc() 14. What is a callback function. Explain in C an d C++ and WIN API environment. 15. (From WINDOWS API area): what is LPARAM and WPARAM? 16. What are the different types of polymorphism? 17. What are Virtual Functions? How to implement virtual functions in "C" 18. What are the different types of Storage c lasses? 19. What is Namespace? 20. What are the types of STL containers?. 21. Is there any difference between a messageand method? 22. If I ask you to write 'VI' editor in C++ - How you'll proceed?

23. Difference between char name[] = prashant n mhatre; and char *name = prashant n mhatre; 24. Should we use global variables? 25. Parsing HTML or XML document with C++ 26. What is 'self assignment'? 27. What is the return value for getch()? 28. can we make any program in c++ without using any header file and what is the shortest program in c++. 29. What is the return value for getch()? 30. How to write c++ program to write a message to the screen? 31. What is the difference between delete and destructor in c++? 32. What is "map" in STL? 33. When shall I use Multiple Inheritance? 34. What are the techniques you use for debugging? 35. How to reduce a final size of executable? 36. Give 2 examples of a code optimization. 37. What is a void return type? 38. How is it possible for two String objects with identical values not to be equal under the == operator? 39. What is the difference between a while statement and a do statement? 40. Can a for statement loop indefinitely? 41. How do you link a C++ program to C functions? 42. How can you tell what shell you are running on UNIX system? 43. Finding shortest path aka Dijkstra's algorithm and backtracking 44. Doing permutations and combinations in C++ 45. Difference between "vector" and "array"? 46. How to write a program such that it wi ll delete itself after exectution?

47. Can we generate a C++ source code from the binary file? 48. What are inline functions? 49. How do you write a program which produces its own source code as its output? 50. How can I find the day of the week given the date? 51. Why doesnt C have nested functions? 52. Is there a way to compare structures automatically? 53. How are structure passing and returning implemented? 54. What is the most efficient way to count the number of bits which are set in a value? 55. How can I convert integers to binary or hexadecimal? 56. How can I call a function, given its name as a string? 57. How do I access command -line arguments? 58. What does static variable means? 59. What is a Pointer? 60. Does C have an equivalent to Pascal's with statement? 61. If an array name acts like a pointer to the base of an array, why isn't the same thing true of a structure? 62. What is a Structure? 63. .What are the differences between Structures and Arrays? 64.Write a program to set 2nd bit in a 32 bit register with memory location 02000? 65. In header files whether functions are declared or defined? 66. When the processor wakes up after power on, it goes to a particular memory location. What is that memory location called? 67. What is the differenc e between an ARRAY and a LIST? 68. What is faster : access the element in an ARRAY or in a LIST? 69. Define a constructor - what it is and how it might be called (2 methods).

70. Describe PRIVATE, PROTECTED and PUBLIC the differences and give examples. 71. What are the differences between malloc() and. calloc()? 72.What's the difference between ++i and i++? 73. What are Macros? What are its advantages and. disadvantages? 74.Does *p++ increment p, or what it points to? 75. Difference between Pass by Value and Pass by reference? 76.What are ``near'' and ``far'' pointers? 77. What is static identifier? 78. Where is the auto variables stored? 79. How can I return multiple values from a function? 80. How can I invoke another program from within a C program? 81. How can I access memory located at a certain address? 82. What is a C array and illustrate the how is it different from a list. 83. What is the time and space complexities of merge sort and when is it preferred over quick sort? 84. Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression. 85. Given n red balls and m blue balls and some containers, how would you distribute those balls among the containers such that the probability of picking a red ball is maximized, assuming that the user randomly chooses a container and then randomly picks a ball from that. 86. Find the second largest element in an array wit h minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same. 87. Given an array of size n, containing every element from 1 to n+1, except one. Find the missing element. 88. How do you convert a decimal num ber to its hexa-decimal equivalent.Give a C code to do the same 89. How can I allocate arrays or structures bigger than 64K?

90. How can I find out how much memory is available? 91. How can I read a directory in a C program? 92. How can I increase the allo wable number of simultaneously open files? 93. Whats wrong with the call fopen(c: \newdir\file.dat, r)? 94. Talk sometiming about profiling? 95. How many lines of code you have written for a single program? 96. What is "strstream" ? 97. How to write Multithreaded applications using C++? 98. Explain "passing by value", "passing by pointer" and "passing by reference" 99. Write any small program that will compile in "C" but not in "C++" 100. Have you heard of "mutable" keyword? 101. What is a "RTTI"? 102. Is there something that I can do in C and not in C++? 103. Why preincrement operator is faster than postincrement? 104. What is the difference between "calloc" and "malloc"? 105. What will happen if I allocate memory using "new" and free it using "free" or allocate sing "calloc" and free it using "delete"? 106. Where does global, static, local, register variables, free memory and C program instructions get stored? 107.Difference between "printf" and "sprintf". 108.Why preincrement operator is faster than po stincrement? 109.Difference between arrays and linked list? 110. What are enumerations? 111. Describe about storage allocation and scope of global, extern, static, local and register variables? 112.How to write a program such that it will delete itself after exectution? 113. What are register variables? What are the advantages of using it?

114.How to write Multithreaded applications using C++? 115. What is the use of typedef? 116. Talk sometiming about profiling? 117. How many lines of code you have written for a single program? 118. How to write Multithreaded applications using C++? 119. What is the output of printf(%d)? 120.How to reduce a final size of executable? 121. Write any small program that w ill compile in C but not in C++ 122. What is Memory Alignment? 123. What are the access privileges in C++? What is the default access level? 124. What is multiple inheritance(virtual inheritance)? What are its advantages and disadvantages? 125. How do you access the static member of a class? 126. What does extern int func(int *, Foo) accomplish? 127. Why preincrement operator is faster than postincrement? 128. What are the techniques you use for debugging? 129. How to reduce a final size of executable? 130. Give 2 examples of a code optimization. 131. Can we specify variable field width in a scanf() 132. format string? If possible, how? 133.Where may variables be defined in C? 134.What is type checking? 135. Difference between strdup and strcpy? 136. What is recursion? 137. What is a NULL macro? What is the difference between a NULL pointer and a NULL macro?

138.What is the purpose of a function prototype? 139. What does the error Null Pointer Assignment means and what causes this error? 140.What is the difference between the & and && operators and the | and || operators? 141. What is near, far and huge pointers? How many bytes 142. are occupied by them? 143. How would you obtain segment and offset addresses from a far address of a memory location ? 144.Where may variables be defined in C? 145. Are the expressions arr and &arr same for an array of integers? 146.From the standpoint of programming logic, what is the difference between a loop with the test at the top, and a loop where the test is at th e bottom? 147. Does mentioning the array name gives the base address in all the contexts? 148.How is a comment formed in C. 149. How do you find out if a linked -list has an end? (i.e. the list is not a cycle) 150. How do you write a function that can rever se a linked-list? 151. Can a copy constructor accept an object of the same class as parameter, instead of reference of the object? 152. What is a local class? 153. What is a nested class? 154. Explain one method to process an entire string as one unit? 155.Is C case sensitive (ie: does C differentiate between upper and lower case letters)? 156. What is the similarity between a Structure, Union and Enumeration? 157.What is the difference between a statement and a block? 158. Can a Structure contain a Pointer to itself?

159. How can we check whether the contents of two structure variables are same or not? 160.Increment the variable next three different ways. 161. How are Structure passing and returning implemented by the compiler? 162.Define a structure for a simple name/address record. 163. How can we read/write Structures from/to data files? 164.What is #ifdef used for? 165. What is the difference between an enumeration and a set of pre processor # defines? What do the c and v in argc and argv stand for? 166.What is the difference between: #include <stdio.h> and #include "stdio.h" 167.Declare a variable with addrPtr called address. 168. What is the maximum combined length of command line arguments including the space between adjacent arguments? 169.What is a structure and a union in C? 170.Why can't you nest structure definitions? 171. How do I initialize a pointer to a function? 172.What is the difference between the & and && operators and the | and || operators? 173.How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters? 174.Is it possible to take the square -root of a number in C. Is there a square root operator in C? 175.How do you define a constant in C? 176.What is the difference between constant to pointer... 177.What are the different types of polymorphism? 178. What are bit fields? 179. Given an array of size n. It contains numbers in the range 1 to n. Each number is present at least once except for 2 numbers. Find the missing numbers.

180. Given an array of size n. It contains numbers in the range 1 to n. Find the numbers which arent present. 181. Given a string,find the first un -repeated character in it? Give some test cases 182. You are given a dictionary o f all valid words. You have the following 3 operations permitted on a word: delete a character, insert a character, replace a character. Now given two words - word1 and word2 - find the minimum number of steps required to convert word1 to word2. (one opera tion counts as 1 step.) 183. Given a cube of size n*n*n (i.e made up of n^3 smaller cubes), find the number of smaller cubes on the surface. Extend this to k -dimension 184. What is the use of bit fields in a Structure declaration? 185.List C's storage clas ses and what they signify. 186. To which numbering system can the binarynumber1101100100111100 be easily converted to? 187. How can I declare a function that returns a pointer to a function of its own type? 188. Which bit wise operator is suitable for chec king 189. whether a particular bit is on or off? 190. Which bit wise operator is suitable for turning off a particular bit in a number? 191.How much memory does a pointer variable allocate? 192. My compiler is complaining about an invalid redeclaration of a function, but I only define it once and call it once. What?s happening? 193.Give 2 examples of a code optimization. 194. Which one is equivalent to multiplying by 2: Left shifting a number by 1 or Left shifting an unsigned int or char by 1? 195.Have you heard of "mutable" keyword? 196.What can I safely assume about the initial values of variables which are not explicitly initialized? 197. Write a program to compare two strings without using the strcmp() function? 198.To what does the term storage cla ss refer?

199. Write a program to concatenate two strings? 200. Write a program to interchange 2 variables without using the third one?

201.I have a function that is supposed to return a string, but when it returns to its caller, the returned string is ga rbage. 202. Write a program for String Reversal? Write a program for Palindrome check? 203.Why am I getting ``warning: assignment of pointer from integer lacks a cast'' for calls to malloc? 204. Write a program to find the Factorial of a number? 205. Write a program to generate Fibonacci series? 206. Difference between C structure and C++ structure. 207. Diffrence between a assignment operator and a copy constructor 208. What is the difference between overloading and overridding? 209. Explain th e need for Virtual Destructor. Can we have Virtual Constructors? 210.What's wrong with casting malloc's return value? 211. What are the different types of polymorphism? 212. What are Virtual Functions? How to implement virtual functions in C++ 213. What are the different types of Storage classes? 214. What is object file? How can you access object 215. file? 216. Which header file should include if you are to 217. develop a function which can accept variable number of arguments? 218. malloc is returni ng crazy pointer values, but I did read question 7.6 and I have included the line extern void *malloc(); before I call it. 219. Can you write a function similar to printf()? 220. How can a called function determine the number of arguments that have been passed to it?

221. In a call to malloc, what does an error like ``Cannot convert `void *' to `int *''' mean? 222. Can there be at least some solution to determine the number of arguments passed to a variable argument list function? 223.You can't use dynami cally-allocated memory after you free it, can you? 224.How does free know how many bytes to free? 225. How do you declare, An array of three pointers to chars? 226.Why doesn't sizeof tell me the size of the block of memory pointed to by a pointer? 227. How do you declare, An array of three char pointers? 228.Is it legal to pass a null pointer as the first argument to realloc? Why would you want to? 229. How do you declare, A pointer to array of three chars? 230. What's the difference between calloc and mall oc? Which should I use? Is it safe to take advantage of calloc's zero -filling? Does free work on memory allocated with calloc, or do you need a cfree? 231. How do you declare, A pointer to function which . receives an int pointer and returns a float pointe r? 232.What are the following and how do they differ: int, long, float and double? 233. How do you declare, A pointer to a function which receives nothing and returns nothing? 234.Can you nest function definitions? 232.What are the following and how do the y differ: int, long, float and double? 235. What do the functions atoi(), itoa() and gcvt() do? 236. Does there exist any other function which can be used to convert an integer or a float to a string? 237.What is a forward reference? 238. How would you use qsort() function to sort an array of structures? 239.What is the symbol for the modulus operator?

240. How would you use qsort() function to sort the name stored in an array of pointers to string? 241.What is an algorithm (in terms of the STL/C++ standard library)? 242. How would you use bsearch() function to search a name stored in array of pointers to string? 243.What is std::auto_ptr? 244. How would you use the functions sin(), pow(), sqrt()? 245.What is destructor? 246. How would you use the functions memcpy(), memset(), memmove()? 247.What is default constructor? 248. How would you use the functions fseek(), fread(), fwrite() and ftell()? 249.What is copy constructor? 250. How would you use the functions randomize() and random()? 251.What is wrong with this statement? std::auto_ptr ptr(new char[10]); 252. How would you obtain current time and difference between two times? 253. When are copy constructors called? 254. How would you implement a substr() function thatextracts a sub string from a given string? 255. Can you explain the term "resource acquisition is initialization?" 256. What is the difference between the functions rand(), random(), srand() and randomize()? 257.What is conversion constructor? 258. What is the difference between the functions me mmove() and memcpy()? 259. What are the differences between a struct in C and in C++? 260. How do you print a string on the printer? 261. Can you use the function fprintf() to display the output on the screen? 262.What is inheritance?

263. What is Namespac e? 264. What are the types of STL containers?. 265. Difference between vector and array? 266. Explain polymorphism. Provide an example. 267. Given an array all of whose elements are positive numbers, find the maximum sum of a subsequence with the const raint that no 2 numbers in the sequence should be adjacent in the array. So 3 2 7 10 should return 13 (sum of 3 and 10) or 3 2 5 10 7 should return(sum of 3, 5 and 7) 268. You are given some denominations of coins in an array (int denom[])and infinite supp ly of all of them. Given an amount (int amount), find the minimum number of coins required to get the exact amount. What is the method called? 269. Given an array of size n. It contains numbers in the range 1 to n. Each number is present at least once exce pt for 1 number. Find the missing number. 270. How to write a program such that it will delete itself after exectution? 271. Can we generate a C++ source code from the binary file? 272. What are inline functions? 273. Differentiate between a FOR loop and a WHILE loop? 274. What are its uses? 275. What are the different storage classes in C? 276. Write down the equivalent pointer expression for referring the same element a[i][j][k][l]? 277.what is the diff between "new" and "operator new" ? 278. What is the difference between Structure and Unions? 279. What is diff between malloc()/free() and new/delete? 280. What are the advantages of using Unions? 281. What are the advantages of using pointers in a program? 282. How can I get the numeric value (i.e. ASCII o r other character set code) corresponding to a character, or vice versa? 283. What is the difference between Strings and Arrays?

284. What is a far pointer? Where we use it? 285. How will you declare an array of three function pointers where each function receives two int and returns a float? 286. What is the right type to use for Boolean values in C? Is there a standard type? Should I use #defines or enums for the true and fa lse values? 287.A third-party header file I just started using is defining its own TRUE and FALSE values incompatibly with the code I've already developed. What can I do? 288. What is NULL pointer? Whether it is same as anun -initialized pointer? 289. Isn't #defining TRUE to be 1 dangerous, since any nonzero value is considered ``true'' in C? What if a built -in logical or relational operator ``returns'' something other than 1? 290. What is strstream ? 291. Explain passing by value, passing by pointer a nd passing by reference 292. Have you heard of mutable keyword? 293. What is a RTTI? 294. Is there something that I can do in C and not in C++? 295. What is the difference between calloc and malloc? 296. What will happen if I allocate memory usin g new and free it using free or allocate sing calloc and free it using delete? 297. Difference between printf and sprintf. What is map in STL? 298.Should I use symbolic names like TRUE and FALSE for Boolean constants, or plain 1 and 0? 299. When shall I use Multiple Inheritance? 300. Explain working of printf. 301. Write a program which employs Recursion? 302. Write a program which uses Command Line Arguments? 303. Write a program which uses functions like strcmp(), strcpy(), etc.? 304.How can I write a generic macro to swap two values? 305. What are the advantages of using typedef in a program?

306.I'm splitting up a program into multiple source files for the first time, and I'm wondering what to put in .c files and what to put in .h files. ( What does ``.h'' mean, anyway?) 307. How would you dynamically allocate a one -dimensional and two dimensional array of integers? 308.Is it acceptable for one header file to #include another? 309. When reallocating memory if nay other pointers point the sam e piece of memory, do you have to readjust these other pointers or do they get readjusted automatically? 310.I'm #including the right header file for the library function I'm using, but the linker keeps saying it's undefined. 311.What is the ``ANSI C Standard?'' 312Does the sizeof operator work in preprocessor #if directives? .313. Which function should be used to free the memory allocated by calloc()? 314.How can I list all of the predefined identifiers? 315. How much maximum can you allocate in a single c all to malloc()? 316.How can I use a macro argument inside a string literal in the macro expansion? 317. Can you dynamically allocate arrays in expanded memory? 318.How can I include expansions of the __FILE__ and __LINE__ macros in a general -purpose debugging macro? 319. What is a void return type? 320. How is it possible for two String objects with identical values not to be equal under the == operator? 321. What is the difference between a while statement and a do statement? 322. Can a for statement loop indefinitely? 323. How do you link a C++ program to C functions? 324. How can you tell what shell you are running on UNIX system? 325. Given a Binary Search Tree, write a program to print the kth smallest element without using any static/global variable. You cant pass the value k to any function also

326. What are the 4 basics of OOP? 327. Define Data Abstraction. What is its importance? 328. What is the output of printf("%d") 329.Why doesn't sizeof properly report the size of an array when the array is a parameter to a function? I have a test routine f(char a[10]) { int i = sizeof(a); printf("%d\n", i); } and it prints 4, not 10. 330.But what about main's third argument, envp? 331.What are #pr agmas and what are they good for? 332.How can I get a copy of the Standard? 333.Why doesn't this fragment work? char *answer; printf("Type something: \n"); gets(answer); printf("You typed \"%s\"\n", answer); 334.Where can I get information about updates to the Standard? 335.But the man page for strcat says that it takes two char *'s as arguments. How am I supposed to know to allocate things? 336.I believe that declaring void main() can't fail, since I'm calling exit instead of returning, and anyway my operat ing system ignores a program's exit/return status. 337.My ANSI compiler complains about a mismatch when it sees extern int func(float); int func(x) float x; { ... } 338.So what could go wrong? Are there really any systems where void main() doesn't work? 339. Is exit(status) truly equivalent to returning the same status from main? 340.Can you mix old -style and new-style function syntax? 341.Can I declare main as void, to shut off these annoying ``main returns no value'' messages? 342. Why can't I pass a char ** to a function which expects a const char **? 343.What does the message ``warning: macro replacement within a string literal'' mean?

344.I heard that you have to #include <stdio.h> before calling printf. Why? 345.What does ``#pragma once'' mean? I found it in some header files 346.I've got the declarations typedef char *charp; const charp p; Why is p turning out const, instead of the characters pointed to? 347..What's the correct declaration of main()? 348.I'm using fgets to read lines from a file into a n array of pointers. Why do all the lines end up containing copies of the last line? 349. If you can't modify string literals, why aren't they defined as being arrays of const characters? 350..Why does the simple line -copying loop while(!feof(infp)) { fgets(buf, MAXLINE, infp); fputs(buf, outfp); } copy the last line twice? 351.What should malloc(0) do? Return a null pointer or a pointer to 0 bytes? 352.Is char a[3] = "abc"; legal? What does it mean? 353.I have a simple little program that reads charact ers until EOF, but how do I actually enter that ``EOF'' value from the keyboard? I see that EOF is defined by <stdio.h> to be -1; am I supposed to enter -1? 354.What's the difference between memcpy and memmove? 355.What's wrong with this code? char c; while((c = getchar()) != EOF) ... 356.Why can't I perform arithmetic on a void * pointer? 357.Why doesn't long int n = 123456; printf("%d \n", n); work? 358.How can I print a '%' character in a printf format string? I tried \%, but it didn't work. 359.Since array references decay into pointers, if arr is an array, what's the difference between arr and &arr? 360.What printf format should I use for a typedef like size_t when I don't know whether it's long or some other type?

361.How can I print numbers wit h commas separating the thousands? What about currency formatted numbers? 362.fopen is failing for certain pathnames. 363.How can I write code to conform to these old, binary data file formats? 364.Why doesn't the call scanf("%d", i) work? 365.How can I i nsert or delete a line (or record) in the middle of a file? 366.. How can I convert numbers to strings (the opposite of atoi)? Is there an itoa function? 367.Why doesn't this code: double d; scanf("%f", &d);work? 368.Does C have anything like the ``substr' ' (extract substring) routine present in other languages? 369.How can I recover the file name given an open stream? 370.Why doesn't the code short int s; scanf("%d", &s);work? 371.How can I redirect stdin or stdout to a file from within a program? 372.. How can I specify a variable width in a scanf format string? 373.Once I've used freopen, how can I get the original stdout (or stdin) back? 374.Why does strncpy not always place a ' \0' terminator in the destination string? 375.How can I read data from data files with particular formats? How can I read ten floats without having to use a jawbreaker scanf format like "%f %f %f %f %f %f %f %f %f %f"? How can I read an arbitrary number of fields from a line into an array? 376.How can I sort a linked list? 377.How can I tell if standard input or output is redirected (i.e. whether ``<'' or ``>'' was used on the invocation command line)? 378.Does C have anything like the ``substr'' (extract substring) routine present in other languag es? 379.When I read numbers from the keyboard with scanf and a "%d \n" format, like this: int n; scanf("%d\n", &n); printf("you typed %d \n", n); it seems to hang until I type one extra line of input.

380.How can I sort more data than will fit in memory? 381.How can I arrange to have output go two places at once, e.g. to the screen and to a file? 382.Why does everyone say not to use scanf? What should I use instead? 383.How can I get the current date or time of day in a C program? 384.How can I tell how much destination buffer space I'll need for an arbitrary sprintf call? How can I avoid overflowing the destination buffer with sprintf? 385.I know that the library function localtime will convert a time_t into a broken-down struct tm, and that ctime will conver t a time_t to a printable string. How can I perform the inverse operations of converting a struct tm or a string into a time_t? 386.I want to read and write numbers between files and memory in a byte -ata-time way, not as formatted characters the way fprin tf and fscanf do. How can I do this? 388.What's the deal on sprintf's return value? Is it an int or a char *? 389.How can I add N days to a date? How can I find the difference between two dates? 390.I'm writing a ``filter'' for binary files, but stdin and stdout are preopened as text streams. How can I change their mode to binary? 391.What's the difference between fgetpos/fsetpos and ftell/fseek? What are fgetpos and fsetpos good for? 392.Did C have any Year 2000 problems? 393.What's the difference between text and binary I/O? 394.How can I flush pending input so that a user's typeahead isn't read at the next prompt? Will fflush(stdin) work? 395. How can I return a sequence of random numbers which don't repeat at all? 396.How can I read/write structures fro m/to data files? 397.How can I generate floating -point random numbers? 398.What does it mean when the linker says that _end is undefined?

399.How can I open files with names like ``file1'', ``file2'', ``file3'', etc., where the numeric part is controlled b y a variable? Basically I want ``file%d'', like printf 400.Is exit(status) truly equivalent to returning the same status from main? 401. Write a program which employs Recursion? 402. Write a program which uses Command Line Arguments? 404. Write a program which uses functions like strcmp(), strcpy(), etc.? 404.Why does the code double degC, degF; degC = 5 / 9 * (degF - 32);keep giving me 0? 405. What are the advantages of using typedef in a program? 406.I'm trying to use pointers to manipulate an array of ints. What's wrong with this code? int array[5], i, *ip; for(i = 0; i < 5; i++) array[i] = i; ip = array; printf("%d\n", *(ip + 3 * sizeof(int))); I expected the last line to print 3, but it printed garbage . 407. How would you dynamically allocate a one -dimensional and two dimensional array of integers? 408.What does typedef int (*funcptr)();mean? 409. When reallocating memory if nay other pointers point the same piece of memory, do you have to readjust thes e other pointers or do they get readjusted automatically? 410.Suppose I want to write a function that takes a generic pointer as an argument and I want to simulate passing it by reference. Can I give the formal parameter type void **, and do something like this? void f(void **); double *dp; f((void **)&dp); 411.How can I define a pair of mutually referential structures? I tried typedef struct { int afield; BPTR bpointer; } *APTR; typedef struct { int bfield; APTR apointer; } *BPTR; but the compiler doesn't know about BPTR when it is used in the first structure declaration. 412.I have a function extern int f(int *); which accepts a pointer to an int. How can I pass a constant by eference? A call like f(&5); doesn't seem to work 414. Which function should b e used to free the memory allocated by calloc()?

414.How can I use statically - and dynamically-allocated multidimensional arrays interchangeably when passing them to functions? 415. How much maximum can you allocate in a single call to malloc()? 416.What i s the difference between these initializations? char a[] = "string literal"; char *p = "string literal"; My program crashes if I try to assign a new value to p[i]. 417. Can you dynamically allocate arrays in expanded memory? 418.And what about this? Isn't this an array assignment? char a[] = "Hello, world! \n"; 419. What is a void return type? 420. How is it possible for two String objects with identical values not to be equal under the == operator? 421. What is the difference between a while statement and a do statement? 422. Can a for statement loop indefinitely? 424. How do you link a C++ program to C functions? 424. How can you tell what shell you are running on UNIX system? 425. Given a Binary Search Tree, write a program to print the kth smallest element without using any static/global variable. You cant pass the value k to any function also. 426. What are the 4 basics of OOP? 427. Define Data Abstraction. What is its importance? 428. What is the output of printf("%d") 429.Why can't I do something like this? extern char *getpass(); char str[10]; str = getpass("Enter password: "); 430.How to convert ascii into number value like if i typed in the letter 'R' it would give me a value of 120 0r something? 431.Is a run-time integral value of 0, cast to a pointer, guaranteed to be a null pointer? 432.How to write a program to read sequences of integer from keyboard.program should sum all even and odd numbers?

433.I use the preprocessor macro #define Nullptr(type) (type *)0to help me build null pointers of the correct type. 434.How to write programing in c++ language to find a solution to an equation by using stack? 435.If NULL were defined as follows: #define NULL ((char *)0) wouldn't that make function calls which pass an uncast NULL work? 436.What is the object -oriented design,inheritance and dynamic polymorphism in c++? 437.Is the abbreviated pointer comparison ``if(p)'' to test for non -null pointers valid? What if the internal representation for null pointers is nonzero? 438.Hi I would like to know how to convert binary to decimal in c++? 439.My compiler isn't letting me declare a big array like double array[256][256]; 440.How to see return value of main function? 441.How are C++ objects laid out in memory? 442.Why is "this" not a r eference? 443.I have some code containing expressions like a ? b = c : dand some compilers are accepting it but some are not. 444.Why is the size of an empty class not zero? 445.Why doesn't C++ have a final keyword? 446.What does the warning ``semantics of `>' change in ANSI C'' mean? 447..How do I define an in -class constant? 448.I'm trying to declare a pointer and allocate some space for it, but it's not working. What's wrong with this code? char *p; *p = malloc(10); 449.How can I implement opaque (abstra ct) data types in C? 450..How do you pronounce "char"? 451.why use sort() when we have "good old qsort()"? 452.How can I understand complex expressions like the ones in this section, and avoid writing undefined ones? What's a ``sequence point''? 454.Do we really need multiple inheritance?

454.Why can't I define constraints for my template parameters? 455.Why doesn't overloading work for derived classes? 456.How do I deal with memory leaks? 457.Why doesn't C++ provide heterogenous containers? 458.Why doesn't delete zero out its operand? 459.Why doesn't C++ have a universal class Object? 460..How do I call a C function from C++? 461.But what about the && and || operators? I see code like ``while((c = getchar()) != EOF && c != '\n')'' ... 462.How do you pronounce "cout"? 464.So if I write a[i] = i++;and I don't care which cell of a[] gets written to, the code is fine, and i gets incremented by one, right? 464.Here's a slick expression: a ^= b ^= a ^= bIt swaps a and b without using a temporary. 465.Why don't we have virtual constructors? 466..I have a complicated expression which I have to assign to one of two variables, depending on a condition. Can I use code like this? ((condition) ? a : b) = complicated_expression; 467.What good is static_cast? 468.How do I use exceptions? 469.Under my compiler, the code int i = 7; printf("%d\n", i++ * i++);prints 49. Regardless of the order of evaluation, shouldn't it print 56? 470.Why doesn't C++ provide a "finally" construct? 471.Why doesn't this code: a[i] = i++;w ork? 472..Why can't I overload dot, ::, sizeof, etc.? 474.Why do people use explicit masks and bit -twiddling code so much, instead of declaring bit -fields? 474.Can I define my own operators? 475Can I call a virtual function from a constructor?

476.Should I use NULL or 0? 477.Is there a "placement delete"? 478.So, what's wrong with using macros? 479.I need to check whether one number lies between two others. Why doesn't if(a < b < c)work? 480.How do you name variables? Do you recommend "Hungarian"?

481.What is "this" pointer? 482.Can we generate a C++ source code from the binary file? 484.Is there a good way of simulating OOP -style inheritance, or other OOP features, in C? 484.Is there a way to compare structures automatically? 485.What does extern "C" int func(int *, Foo) accomplish? 486.How are structure passing and returning implemented? 488.How can I pass constant values to functions which accept structure arguments? How can I create nameless, immediate, constant structure values? 489.Does C have an equi valent to Pascal's with statement? 490.Name the operators that cannot be overloaded?? 491.Can a structure contain a pointer to itself? 492.What is "strstream" ? 494.Can I initialize unions? 494.Can a copy constructor accept an object of the same class as p arameter, instead of reference of the object? 495.What are the techniques you use for debugging? 496.What's the difference between const char *p, char const *p, and char * const p? 497.How should I decide which integer type to use? 498.What does extern mea n in a function declaration?

499.How do I construct declarations of complicated types such as ``array of N pointers to functions returning pointers to functions returning pointers to char'', or figure out what similarly complicated declarations mean? 500.What are C++ storage classes?

http://enggedu.com/academic_projects/academic_projects.php

You might also like