No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
9 Posted Topics
Hi, if u dont want that error message , define the display() (in class stack ) function outside the class. Actually all the function defined within the class are considered as inline function automatically. inline function is just a recommendation to the compiler. compiler may ignore this recommendation. now any …
// assuming u know that the key code of appropriate key... // write these statments after the menu in your program // KEYA, KEYB are the keycodes for key A, key B ... // u can generate key code using getch(); if(kbhit()) key=getch(); switch(key) { case KEYA : // action …
Why don't you read 'Unix System Programming using C++' by terrace chan. this book gives indepth details on how to design a shell.
hi, in c/c++ we have a function system() that lets us to call any external application from the c/c++ program. i wanted to knw that do we hve any similar function/method in C#?
there is another way of doing this.. using realloc() function u can dynamically allocate the memory u need for ur string. first allocate memory just for a character. now start scanning characters from console. until the new line is entered, reallocate the extra memory u need. hope this will solve …
Here is ur modified while statement .... while (fscanf(input, "%f\t%f", &x, &y) != EOF) { count++; if(count==1) { xmax=x; ymax=y;} else {if(xmax<x) xmax=x; if(ymax<x) ymax=y; } sumx += x; sumy += y; sumx_sqrd += x * x; sumy_sqrd += y * y; }
here is the recursive code for calculating power of 2; int power(int num) { if(num==0) return 1; if(num==1) return 2; return 2*power(num-1); } well after including this function in ur prog, u dont need to check whether the input value is 0 or 1. but check for -ve entry.. here …
Here is the modified program... Now this program will work fine even at the menu prompt, if u enter any number.. Except 1, 2, & 3, it will generate a error msg ...(Check out the default statement in main(). [code] // a) to find whether a given no. is prime …
recursive algorithm : height(tree * ){ if(root==NULL) return 0; return 1+max(height(root->left),height(root->right)); } hope u can write a function for max(par1, par2) also. ok
The End.
kunal_ktr