15,551 Topics

Member Avatar for
Member Avatar for PeterX

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 …

Member Avatar for Dave Sinkula
0
117
Member Avatar for smithag261

I want to know how to write a program to print all Armstrong numbers between 1 and 500.

Member Avatar for Dave Sinkula
1
204
Member Avatar for yarlini

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 …

Member Avatar for CrazyDieter
0
145
Member Avatar for md_salman

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 …

Member Avatar for ITgeneration
0
155
Member Avatar for Mahen

1. typedef int (*MYPROC)(LPTSTR); 2. hinstLib = LoadLibrary(TEXT("myputs")); 3. ProcAdd = (MYPROC) GetProcAddress(hinstLib, TEXT("myPuts"));

Member Avatar for Dave Sinkula
0
73
Member Avatar for 123abc

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 …

Member Avatar for 123abc
0
240
Member Avatar for SpS

[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??

Member Avatar for Drowzee
0
165
Member Avatar for k_en

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)

Member Avatar for Ancient Dragon
0
107
Member Avatar for desertstorm

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

Member Avatar for desertstorm
0
127
Member Avatar for cuonggenie

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 …

Member Avatar for Drowzee
0
90
Member Avatar for PeterX

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 $ …

Member Avatar for Drowzee
0
319
Member Avatar for Mahen

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 …

Member Avatar for Mahen
0
286
Member Avatar for Funktar

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 …

0
101
Member Avatar for DotNetUser

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 …

Member Avatar for Drowzee
0
252
Member Avatar for Mike182

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 …

Member Avatar for Mike182
0
251
Member Avatar for Drowzee

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. …

0
106
Member Avatar for ashwinperti

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

Member Avatar for Balachandran
0
166
Member Avatar for SpS

sizeof (int) gives me 4 bytes...is it sufficient to say that my machine is of type 32-bit

Member Avatar for SpS
0
353
Member Avatar for shaji

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

Member Avatar for Stoned_coder
0
108
Member Avatar for Niklas

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 …

Member Avatar for Niklas
0
160
Member Avatar for pre_wreck

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 …

Member Avatar for pre_wreck
0
175
Member Avatar for mycomputerdied

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.

Member Avatar for chrisbliss18
0
128
Member Avatar for Drowzee

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, …

Member Avatar for Drowzee
0
247
Member Avatar for spaceytrin

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 …

Member Avatar for spaceytrin
0
125
Member Avatar for Mahen

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.

Member Avatar for CrazyDieter
0
215
Member Avatar for toxic_iguana

#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 …

Member Avatar for toxic_iguana
0
101
Member Avatar for glamo

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) …

Member Avatar for Narue
0
144
Member Avatar for SpS

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

Member Avatar for SpS
0
167
Member Avatar for SpS

From where can i find the header file unistd.h...one of my program requires it

Member Avatar for Narue
0
117
Member Avatar for WrEcK

i'm having a little trouble grasping the concept of this. If someone could help it would be great. Its part of my assignment...no i don't want u to do it for i just need help. 1. declare an ofstream foutput in main function 2. open a file in main function …

Member Avatar for Narue
0
114

The End.