15,552 Topics
| |
Hi all. I need some help counting specific numbers in C. The programme should accept two sets of numbers. It should then count how many of the second number is in the first set. For example: First input = 23387 Second input = 3 Ouput = "Number 3 appears twice … | |
Code 1 [code] class Drink { public: Drink( char *name_ ) : name( name_ ) {} char *name; char get(int i) const { return name[i]; } }; [/code] Code 2 [code] class Drink { public: Drink( char *name_ ) : name( name_ ) {} char *name; char & get(int i) … | |
This is probably a stupid question, but i dont get the answer. Plz help me understand. Question: How could a linked list and a hash table be combined to allow someone to run through the list from item to item while still maintaining the ability to access an individual element … | |
hi i m student and m making paint brush . i want to get image inside a circle to paste anywhere on screen. actually i want to create a circle with the previous screen under the circle to be visualize again so that my circle would look like empty circle … | |
1. I am using strtok() and am storing the return value into a char array. eg. char word[]; word = strtok(file[][], " "); Do I need to initialize 'word' to a constant size before using it? The thing is I don't know how big the string from strtok is going … | |
[code] # include<stdio.h> void main() { int p; p = (1,2,2,100,1); printf("%d",p); } [/code] I dont know what will be the output . Can anyone please tell me what exactly second line implies ?? :rolleyes: | |
Hi! I want to write a program to calculate Fibonacci number NON-RECURSIVE I tried many times but I could not get the result(0-1-1-2-3-5-8...). Please help me. [code] #include <stdio.h> unsigned int f(int n) { int i; unsigned int last=0,current=1; int result; for(i=1; i<=n; i++) { last+=current; //???????? printf("-%d",last); } return … | |
We have a struct defined as : typedef struct tagWINDOWPOS { /* wp */ HWND hwnd; HWND hwndInsertAfter; int x; int y; int cx; int cy; UINT flags; } WINDOWPOS; Then we are sent a message... WM_WINDOWPOSCHANGING WPARAM wParam LPARAM lParam; Parameters wParam This parameter is not used. lParam Pointer … | |
[code] #include<stdio.h> int main(){ double price=500; double year=5; double total; if(price==500) { //???????????????????? scanf("%f", &price); printf("%f\n", price); } total=(price * year); printf("%f\n", total); } [/code] why the scanf() can not get a new value from keyboard. I want to give a new value to the price but the out put … | |
I happen to be writing a very simple text browser, and I'm having a problem connecting to servers using HTTP1.1 GET messages... HTTP1.0 works fine, I just have a string like this: [CODE] const char *request = "GET / HTTP/1.0\n\n"; [/CODE] This works great, and I receive my html back … | |
how can create password for database programatically through ADO open connection? | |
I've been trying to compile OSKit under Cygwin. It gave me a bunch of errors, most of which I fixed. I can't fix this one though: [code] /* * Copyright (c) 1996-2000 University of Utah and the Flux Group. * All rights reserved. * * This file is part of … | |
Hi! I have problem with type conversion. when I compile the program I get this error: ( 'count' : redefinition; different basic types ). please tell me about type conversion. [Code] #include<stdio.h> int count(double houre, double charge); int main(){ double h=4; double c=2; printf("%d\n", count(h,c)); return 0; } int count(double … | |
When a structure is assigned, passed, or returned, the copying is done monolithically....what does this monolithic mean any example?? | |
I everyone, I have two C Socket questions. I have searched the net and read my reference books, but cannot find my answer. Anyway, I am making a simple telnet based server. To create a new socket I am using the following code: [CODE]newsockfd = accept(sockfd, (struct sockaddr *) &cli_addr, … | |
As null pointer points to nothing. So, How does the following code works #include <stdio.h> class cb { public: void HelloB() { printf("Calling cb\n"); }; }; int main(void) { cb* pb = 0; pb->HelloB(); // should it crash here ? return 0; } | |
hi everybody. i am trying to develop a program that will be able to read and export informations (hw, sw, kernel, netstats..ecc) from a linux computer. my idea was to use the files in the [b]/proc[/b] directory but i can't get the script to work - this is what i … | |
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 | |
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 |
The End.