© 2014 Firstsoft Technologies (P) Limited. login
Hi 'Guest'
Home SiteMap Contact Us Disclaimer
enggedu


  Home Placement Paper Kit Technical Questions ► C and C++ ▼

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 can’t 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 #pragmas 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 operating 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 an 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 characters 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?

Page 9

1 2 3 4 5 6 7 8 9 10 11 12 13
SLogix Student Projects

⇓Student Projects⇓
⇑Student Projects⇑
bottom