19,876 Topics
![]() | |
I need help with some homework. I need to write a program that uses a while statement to determine and print the largest number of 10 numbers input by the user. The program should use three variables: counter: A counter to count to 10, (to keep track of how many … | |
Hi All, Iam wondering is there any opensource xhtml parser (c) available ? Thanks in advance - | |
[code] #include <iostream> int main(int argc, char *argv[]) { int count=0; if (argc<2) { std::cout<<"Wrong No Of Parameters"; exit(1); } FILE *file; file=fopen(argv[1],"r"); char c; while((c=getc(file))!=EOF) { if (c=='\n') { count+=1; std::cout<<std::endl; } else printf("%c",c); } std::cout<<"\nNo Of Lines In the File :"<<count+1; fclose(file); return 0; } [/code] My program … | |
I've got a function with a variable list of arguments: [CODE]Execute(int arg1, int arg2, int arg3, int arg4, int argLast, ...)[/CODE] I want to write another function that intercepts Execute. I want it to have the same argument list and pass all these arguments to Execute. For example something like … | |
am currently building a program that runs as a background process, but due to the loops inside it, Windows fails to Close it when it goes into either shutdown or LOGOFF mode. It is a GUI program that uses WINMAIN but without a GUI interface. Can you tell me how … | |
Hey guys am new in C, could anyone help me with this? write a program that store the values x and 76.1 in seperate memory cells, your program should get the values as data itmes and display them again for the user when done. thanks | |
Hi Guys I am a new member here and basically i have joined because i would like to learn some c++. I have no prior experience in any of these high level languages. I do have experience in turbo pascal but those of you who have used it know how … | |
Hello, by searching explanations and code for heap sort I found tghis code: [code] #include <stdio.h> #define less(a, b) ((a) < (b)) static void exchange ( int *a, int *b ) { int t = *a; *a = *b; *b = t; } static void fixDown ( int *a, int … | |
| |
i need help on a program that uses zenos series which calculates the sum of the first N terms of Zenos series, where N is what the user inputs. it should be a number 1 and 15 (inclusive). program should print n terms of the series seperated by + and … | |
What purpose exactly does scaling / shifting rand values serve? The book I'm learning from really doesn't seem to explain what these actions do. -Clifton | |
Hie, Do you know how to read the activity of a serial device (COMx) under windows ? I would like to write a program that could sniff the serial/ port. | |
Basically I've got a const string (it stays the same lenght) Only trying to implement it into OOP. heres the constructor: [php]score::score(void) { lives = 5; char * end = { " --------------+-\n" " + |\n " "+ ?\n" " +\n" " +\n" " +\n" " +\n" }; strcpy( death, … | |
Hi, I have a program that needs to perform billions of loops. I want to print out something to the screen for every certain number of iterations (ie let's say 1 million). Because % is only suposed to work for integers, how do I get the equivalent functionality with long … | |
right now i am making project on RC4 and i have gotten a lot problem about fixing error i do not know which i did wrong if possibly anyone who ever done RC4 coding project before pls give me an advice. thank u | |
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 $ … | |
I need to write a program in C++ that will compute numeric grades for a course. The course records are in a file that will serve as the input file.Each line will have a last name, first name, ten quizes all on one line... you should calculate the average and … | |
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 … | |
Ive searched through google and most are not free, and the ones that are are being declared have a virus inside by norton as well as ewido. BTW im trying to do this because there was a PSP (playstation protable bin loader released) [URL=http://www.psp-hacks.com]website and article here[/URL]. I wanted to … | |
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 | |
Dear all, I'm developing an SNMP manager using WinSNMP API. While starting up the SNMP by calling the function SnmpStartup, it returns SNMPAPI_SUCCESS, but strangely the 5 output parameters are not defined after the function is executed. Is this normal? Why is this happenning? What should I do? Regards, Alan … | |
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 … | |
I keep getting this error message and the code below: I can't figure out why any help would be appreciated. Line 51 is this statement in my code: Element* Stack::Element::Prev(void) error message: [code] In file included from Stack03.cpp:28: Stack03.h:81:7: warning: no newline at end of file Stack03.cpp:51: syntax error before … |
The End.