15,550 Topics

Member Avatar for
Member Avatar for AfroZenPizza

I need a better solution to a while loop that continualy checks the current time against the time that the user would like the program to end. This loop spikes the processor usage to 100%. [CODE]while( time(NULL) <= endTime ) { printf("\r%4d", endTime - time(NULL)); }[/CODE] Thanks in advance.

Member Avatar for jephthah
0
65
Member Avatar for cskumar

i have a online logging of data through com port. the c program captures the online data every 1 minute, calculates ten minute average, standard deviation and then writes it to a file. the file is created with getdate function. when the day changes, i have to create the new …

Member Avatar for Ancient Dragon
0
86
Member Avatar for smitem03

this is coming off a program that collects information and saves it after every command. I have opened my file successfully cause thats how it reads the client. the problem is saving the data. Does this code look right to everybody??? I am running in C and very very basic. …

Member Avatar for jephthah
0
88
Member Avatar for ni30rocks

I am developing i a c-editor which can run graphics on VISTA and can use minimum system RAM and processes. I need C help file database wich can be linked to my software

Member Avatar for ArkM
0
80
Member Avatar for boujibabe

I thought I was finished with this program but now I can’t find a way to make it quit. The loop continues even when I enter the terminating character. I’ll post he whole thing. The answer may be simple but I'm just not seeing it. [code] do{ do{ system("cls"); printf("Enter …

Member Avatar for jephthah
0
194
Member Avatar for gamodg

Hi I have a cgi controller that takes requests and depending on request it invokes the object of the desired class which generates a XML and sends the XML as a response. On the client this XML is combined with XSL to display a HTML page. For ex. [CODE] request---->controller------->router.cgi(a …

Member Avatar for Salem
0
70
Member Avatar for Svolacius

In file "sudoku.dat" is 9x9 size matrix. In one 3x3 bloc, can be from 2 up to 6 unknew digits, however main unknow digits amount in all matrix, must be not over 36 digits. Unknow places marked with symbol ? Example (3x3) ?9? 4?? ?32 I need program which could …

Member Avatar for Aia
0
117
Member Avatar for qajaq49

I'm trying to write a short bit of C code that will get a filename from the user, via the keyboard, and open the specified file, but I haven't been able to get fopen() to recognize the variable filename when I use fgets() to get it. Here's a snippet of …

Member Avatar for qajaq49
0
684
Member Avatar for karthik.c

hi guys im trying to code patricia trie in c using gcc and when i debuged the program im gettin segmentation stack problem in search function of it.im not sure why it is showing and i've included pat.c,pat.h and ncspatricia.h files. i also want to know what is the difference …

Member Avatar for karthik.c
1
150
Member Avatar for kaku_lala

Hi Guys, First post here, so be gentle :-) I was going looking for an implementation of memcmp(), I found this code snippet, but it is clearly marked that there is 1 logical error with the code snippet. Could you help me find the logical error. Basically, I tested this …

Member Avatar for ArkM
0
344
Member Avatar for kaku_lala

The definition of library function strspn is: [CODE]size_t strspn(const char *str, const char *chars) /*Return number of leading characters at the beginning of the string str which are all members of string chars.*/[/CODE] e.g. if ‘str’ is “fecxdy” and ‘chars’ is “abcdef” then the function would return 3, since ‘f’, …

Member Avatar for Aia
0
92
Member Avatar for anraevlus18

please help me.. am using turbo c 3.00 i'm gettin a compile time error : Lvalue required. ------------------------------------------------------------- [code] #include<stdio.h> #include<conio.h> #include<stdlib.h> int func(int x,int y) { int *ptr1=&x,*ptr2=&y; int **ptr_1,**ptr_2; *ptr_1=ptr1; *ptr_2=ptr2; printf("\nUsing function pointer : "); printf("\nx=%d\ny=%d",**ptr_1,**ptr_2); int sum=*ptr1+*ptr2; return sum; } main() { int *fnptr(int,int); // declare …

Member Avatar for Ancient Dragon
0
96
Member Avatar for jyo_84

can any one help, need a program to search a particular word in a file (its a .dat file ) then count the number of it occurrences in the whole file, output the count on console. I have not worked with programs before..........

Member Avatar for mayank.cracker
0
74
Member Avatar for grandalf62

I would very much appreciate any advice on this. I am reading a single byte from the serial port and wanting to store up to a hundred of these. Essentially I need to check incoming data to see if the value of it has been sent previously. These are my …

Member Avatar for jephthah
0
87
Member Avatar for OffTheLeft

Hi all, I am in need of some assistance with addresses & pointers as my dysfunctional professor is of no help. (I'll be as succinct as possible.) First, the program must call three subroutines from main to fill "n" array elements with a given value; for instance, one must set …

Member Avatar for OffTheLeft
0
100
Member Avatar for BruenorBH

I want a user to be able to select an audio file to play but am unable to figure out how to create a file open dialog box in Win32 API. I could create one from scratch but am hoping that there is an easier way than manually creating it. …

Member Avatar for BruenorBH
0
165
Member Avatar for metal_butterfly

I have a client /server file operation program.It works properly when i run the client and server program in the same system.but when i try to run the client in one system and server in another system i am getting an error in the cleint machine as "ERROR:Connection refused". Plz …

Member Avatar for xyzt
0
103
Member Avatar for TheBeast32

Hi, I'm using GNU MP to get very precise square roots of numbers. I have three questions about my code below. [Code] #include <stdio.h> #include <stdlib.h> #include <gmp.h> int main(int argc, char *argv[]) { mpf_t num, sqrt; FILE *out; mpf_init2(num, 1000000); mpf_init2(sqrt, 1000000); printf("Enter a number to get its square …

Member Avatar for jephthah
0
188
Member Avatar for tasosa

[code=language] #include <string.h> #include <stdlib.h> #include <stdio.h> /* uni() function takes an array an thier size.and it produce an array which is include unique element */ int uni(char **arr,int size) { int unique = 0; /* The length of dst after removing duplicates */ int n=size; char *dst[n]; /* The …

Member Avatar for Narue
0
190
Member Avatar for vddmanikanta

Sairam Hai everyone,I just want to know : 1. what is full form of asm 2.what is the equivalent C code supported by gcc.running on SUSE Linux platform. asm PUSH;CLI asm POPF

Member Avatar for Narue
0
53
Member Avatar for legendarya49

I'm trying to determine if the characters in the maze can escape, the characters are labeled by their initials except for D which is the door here is the input data: 11 13 7 10 XXXXXXXXXXXXX X JX AX X XXXX XXXXBX X X X SX X X X XXXX …

Member Avatar for jephthah
0
183
Member Avatar for FandaR

Hi, i need to school some C code. Requirements are: Use in code some Functions with parameters, pointers, strucutres and global and private variables. Dont you have some code for it? I havent time to do it. Thank You very much.

Member Avatar for Narue
0
77
Member Avatar for anujsharma

Hi, Am anuj joined community today itsel.I have written a code which generates alpha numeric charaters and stores it in(file1).Then read the generated stuff 4 characters in file(by reading from file1)and appending "-" after 4 characters until "$" is encountered.I am getting an extra "-" in the file please tell …

Member Avatar for jephthah
0
442
Member Avatar for tfurrows

I am modifying the WDK "genprint" Print Processor example. Everything is working great, and I can compile fine, but I am running into a snag with one thing. Part of my modification knowingly triggers a print error, and Windows re-submits the print job automatically in the spool. I need to …

Member Avatar for jephthah
0
116
Member Avatar for raevin

Long story short, writing a multithreaded honey pot, and am having issues starting the honey pot servers. I'll get straight to the code, then explain the issue: Structure defs: [code=c] typedef struct __GENERIC{ int sock; char buff[MAXBUFF]; char ip[17]; int status; int port; int max_conns; // dMaxClients (Master = max …

Member Avatar for ArkM
0
159
Member Avatar for cool_aj

Hi everyone,this program prompts a user for a leap yr code and a day code resulting in an entire year's calendar.The result displays months one below another.Can some one tell me how to make it print 2 months next to each other,that is JAN FEB then MAR APRIL below them. …

Member Avatar for cool_aj
0
111
Member Avatar for rEhSi_123

I am begginer in C so please be easy on me.....:-) Anyways....my query is I have a server and a Client program written in C(attached below) for test in UNIX/LINUX in which the client sends a request to the server and the server then sends back the request to the …

Member Avatar for jephthah
0
172
Member Avatar for smitem03

Hey guys below is my full code of the program I am trying to run. I want to save the data automatically. It goes through many areas but the save area is not working for some reason. Errr...I have spent many hours and it is very basic code probably because …

Member Avatar for jephthah
0
149
Member Avatar for DJInsane

It is a grading system, but its not calulating the grades [ICODE]#include<stdio.h> #include<conio.h> #include<string.h> #define max 2 void Cal_semester_Grade(char studname[][25],int gradeavg[][1],int examAvg[][1]); void Class_Grade(char studname[][25],char classname[5], int classgrd[][3],int gradeavg[][1], int Maxtestscr[][3],char subjectname[15],int classprectge[][3],int finalClassgrade[][1]); void Exam_Grade(char studname[][25], int examMarks[][2], int MaxExamTest[][2],int Examperctage[][2],int examAvg[][1],int finalExamgrade[][1],int paperweight[][2]); //void search_name(char); void Menu(); char …

Member Avatar for Ancient Dragon
0
113
Member Avatar for drjay1627

hey can someone suggest the best way to get the list of files in a directory. i only need files no need directories. given a folder, i want to write a program that gets all the files in it. its part of a much bigger program. appreciate any help. many …

Member Avatar for jephthah
0
113

The End.