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 these 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 be 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 is 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 can’t 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?
Page 11
|