15,552 Topics
| |
We cannot have static friend function...is it because 1.since static member functions can access only static data members...whereas friend function can access all the members. 2.friend function also require an object to access the members...wheeras static member functions can not. 3.One more thing....since friend functions are non-member functions....and static functions … | |
Hi! I want to learn C programming. I have problem whit print out. if I have: [code] double value_1; int value_2; // how do I print out double ....? printf(?????) [/code] if I have [code] int A=5; double B=10.5; result=(double) A/B // the result type is double but how do … | |
I want to know how to write a program to print all Armstrong numbers between 1 and 500. | |
Hi ive had to write an emulator for a specific MIPS program in C, but i also need to either single step through the emulator one instruction at a time or simply let it run, at the moment its running, but im not sure how i can step through it … | |
although this question is basically related to a data structure, still I think that a good progrmmer should be able to answer it. My question is that [B]"is it possible to determine the order in which some ( numbers or characters etc ) are arrived for insertion into a min … | |
1. typedef int (*MYPROC)(LPTSTR); 2. hinstLib = LoadLibrary(TEXT("myputs")); 3. ProcAdd = (MYPROC) GetProcAddress(hinstLib, TEXT("myPuts")); | |
Write a program that prompts the user to input a length expressed in centimeters. The program should then convert the length to inches and output the length expressed in yards, feet, and inches, in that order. For example suppose the input for centimeters is 312. To the nearest inch, 312 … | |
[code] #include <stdlib.h> #include <stdio.h> #define SIZE 15 int main() { int *a, i; a = (int*) malloc(SIZE*sizeof(int)); for (i=0; i<SIZE; i++) *(a + i) = i * i; for (i=0; i<SIZE; i++) printf("%d\n", *a++); free(a); return 0; } [/code] Why Is My Program Crashing?? | |
Do anyone know why i got this error mesage ? Linking... msvcrtd.lib(crtexe.obj) : error LNK2001: unresolved external symbol _main Debug/welcome.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. welcome.exe - 2 error(s), 0 warning(s) | |
Could someone help me with this. I need to know how to write this in code for C. "if hashValue(variable) has a non-zero bit in the 4 leftmost (highest) bits" It has to do with bitwise shifting and is basically just an if statement's condition. Thanks | |
there is a stack which is pushed with different size pancake. the problem is how to sort this stack so that the largest pancake is on the bottom the smallest is on the top. The size of pancake is given by the integer. for example 8 6 4 5 7 … | |
Hi! [code] for (year = 1; year <= 15; year++) { cost = (interest_cost + monthly_instalment); totalCost+=cost; //after how many years the totalCost > price if(totalCost>price) printf(" %d ", year); } [/code] question:after how many years the totalCost > price? my problem: if the price is equal to 10 $ … | |
Hey, I don't know if am wrong but I think a new idea has just striked me. We can all see that almost every program that we can imagine of has been created, thus making it difficult for us to think of new ideas or programs. But all these programs … | |
Hi, so I've got this program("main") that fork executes another ("user"). These programs communicate through fifos. One communication is a spawn call, where user passes an executable, main forks and executes it. So, I'm keeping track of all my processes using a task table. After the fork (for the spawn … | |
I have a string that is retrieved from a socket. I display this string as the text of a button. Some strings contains a '' which doesn't get printed because it's an escape character. So, I want to find all '' and replace it with a "\\" so it will … | |
I was wondering if anyone could help me with some things, im planning on making a little security program that comes up after logon to windows through the logon screen, reads a password from a file specified (for example 'E:\password.txt', and asks you to put in your password, if its … | |
I'm almost done with my project, due in great part to the support and well-reasoned criticism here at Daniweb. But there's one last little problem that's only hitting me in release mode. In debug, the following function works fine to set information from a user-entered string to the CString/CString Map. … | |
void main() { float a = 0.7; if(a < 0.7) printf("YES"); else printf("NO); } But this function always prints NO. And when it is made Greater than 0.7 It shows YES Why is it so with float variable Ashwin Perti | |
sizeof (int) gives me 4 bytes...is it sufficient to say that my machine is of type 32-bit | |
hi friends, please help me by posting the detailed memory map of windows operating system. actually i have posted the same question last week but no reply. thank u | |
Okay Im going to try to make an Ebay auto bidder. Here is the layout of the program that I have brainstormed so far. 1. Enter URL of auction you would like it to bid on 2. It automatically checks how much time is left in auction and refreshes every … | |
dear guru's, I had a problem in C, and i seems i can't figure out why this piece of codes seems not working properly, kindly help my with my little problem? /* My problem here is, how can i copy the file into other file name, i just wanted to … | |
help my cd drive doesnt work. now i cant play any games on my computer. i dont thinks its the cd drives fault i think it has to do with the computer. the last site i went to didnt help at all realy. | |
Hello. I've just discovered that I didn't think a cunning plan all the way through. I've got a grid with a bunch of columns and rows holding CStrings. What I'm doing is trying to filter the grid to only display certain strings. The user selects a location in the grid, … | |
I have this program that I need to write, but I'm so lost. I have gotten some things down and think I'm on the right track, but am stuck with how to set up the array and then how to do the tabular format...everything else I have down (if that's … | |
I am using the win32 CreateFile and ReadFile API to read Files on my HD but it stops reading when it encounters a null termination('/0'). Could you tell me of a way to overcome this and continue to read the whole file. | |
#include<stdio.h> int main() { float f1,f2,f; double d1,d2,d; char s1[]="2.0045",s2[]="1.00056"; f1=atof(s1); f2=atof(s2); f=f1-f2; d1=atof(s1); d2=atof(s2); d=d1-d2; printf("\n%s %s",s1,s2); printf("\n%f %f : %f",f1,f2,f); printf("\n%ld %ld : %d\n",d1,d2,d); return 1; } Output: 2.0045 1.00056 1271310336.000000 869988544.000000 : 401321792.000000 -67108864 1104343465 : 1870659584 Desired Output: 2.0045 1.00056 2.0045 1.00056 : 1.00394 2.0045 1.00056 … | |
CAN ANYONE EXPLAIN THE OUTPUT OF THESE PROGRAMS: [code] /* Explain the output*/ #include<stdio.h> int main() { if(printf(5+"Good")>0) printf("morning"); return(0); } [/code] [code] /*Debuh as per i/p o/p*/ #include<stdio.h> int main() { long steps,fval,bstp,cnt1; int num,unit,box[2][13],cnt2,cnt3,cnt4; printf("Enter number:"); scanf("%d",&num); num=num<1?1:num>12?num:12; for(steps=1;cnt1=2;cnt1<=num;steps *= cnt1++); for(cnt1=1;cnt1<=steps;cnt1++) { for(cnt2=1;cnt2<=num;cnt2++) box[0][cnt2]=cnt2; for(fval=steps;bstp=cnt1;cnt2=1;cnt2<num;cnt2++) { if(bstp=0) … | |
Plz See [code] #include<stdio.h> #define TOTAL_ELEMENTS (sizeof(array) / sizeof(array[0])) int array[] = {23,34,12,17,204,99,16}; int main() { if(-1<= (TOTAL_ELEMENTS-2) ) printf("%s","gotcha\n"); else printf("%s","oops\n"); return 0; } [/code] why is it printing oops | |
From where can i find the header file unistd.h...one of my program requires it |
The End.