15,550 Topics

Member Avatar for
Member Avatar for helloan

Hi, I really need some help with this project. I'm currently a beginning C student working on a wheel of fortune program. For this program a random phrase must be chosen from a text file; the same phrase cannot also be used again during the game (there are three rounds). …

Member Avatar for jephthah
0
161
Member Avatar for Maabou

I need help desperately. To declare an array to hold 5 fives and pass the entire array to it and convert all the measurements in centimeters. The following is what I came up with: [code=c] #include <stdio.h> #define SIZE 5 double calculateInches1 (double); double calculateInches2 (double); double calculateInches3 (double); double …

Member Avatar for midimatt
0
159
Member Avatar for learning C

i have to write an image processing program that can invert, blur, sharpen, threshold, and then resave an image. here is what i have so far: [code=c] //---------------------------------------------------------------------- // SECTION 1: Preprocessor Commands //---------------------------------------------------------------------- // Include Win32 API Libraries (headers) #include <windows.h> #include <windowsx.h> #include <commctrl.h> #include <string.h> #include <stdio.h> …

0
57
Member Avatar for BigFormat

Hi all, I've done this prog to get the last token in a string es: /dir1/dir2/file.txt must return --> file.txt I get several errors on assignments, what's wrong with it? many thanks [CODE] int main() { char *path; char *filename; path = (char*) malloc(sizeof(char) * 64); strcpy(path, "/dir1/dir2/file.txt"); filename = …

Member Avatar for BigFormat
0
1K
Member Avatar for Stack Overflow

Hello, I am trying to determine the best possible solution to accomplish a simple, yet complex task. ([i]Regarding: Socket Programming[/i]) I've been working on a new project for quite some time and have written a custom framework from the ground up. It's more or less a ([b]Client --> Server --> …

0
139
Member Avatar for perfectstranger

Good day everyone. I have an assignment and I can't get rid of this. In this programming assignment I am asked to write a computer program that simulates Nondeterministic Finite Automaton. Program will take NFA from a text file. The format in text file should be like this ; Number …

Member Avatar for perfectstranger
0
80
Member Avatar for midimatt

Hi everyone, i'm back with another problem that i cant seem to work out. i'm trying to read in a .obj file which is basicaly a list of vertices and facets in this format v 0.00 0.00 0.00 f 0 0 0 i dont know before hand how many vertices …

Member Avatar for Prabakar
0
116
Member Avatar for El Duke

Hello there, I was trying to implement a program for a friend of mine in C, this program has to read the HTML user input (directly or from a file), check that input if the HTML tags are put in their correct order. For example, If I entered [CODE]<HTML><[COLOR="Green"]/[/COLOR]BODY>Whatever text<BODY></HTML>[/CODE] …

Member Avatar for El Duke
0
534
Member Avatar for larryeis

Hey, I'm trying to understand how to float a pointer so that the pointer passes decimal places, and i am lost in the sauce. is it supposed to look like this? Thanks in advance. [code] int object1; object1 = 100 ; int object2; object2 = 1000; float *ptr_object1 = &object1; …

Member Avatar for Prabakar
0
88
Member Avatar for arunkp

friends i need to send AT or ATX commands using c language i tried to write the data using biosserialcom() fn to write to serial port in win XP. but it failed .some error camesayin "16bit msdos subsystem error" my question is whether i will be sucessful if i tried …

Member Avatar for jephthah
0
210
Member Avatar for bodom_lx

Hi everybody, I've got a question for you. As assignment for the dsa course I've got a task regarding an array with cost values stored in each cell. The following is the array: [CODE="C"] int C[5][5] = { {8, 2, 3, 1, 5 }, {0, 6, 4, 9, 7 }, …

Member Avatar for Salem
0
98
Member Avatar for rob_xx17

hello, I'm writing a program to collect the data from a sonar of a robot. the robot is running Fedora 6. I want to collect the data in an external file as there is a lot of information to be reviewed. the program is fine when I direct the sonar …

Member Avatar for jephthah
0
2K
Member Avatar for umeshjaviya

I am a new guy in C. But I have read stuffs about Malloc, Realloc, how to pass pointers to the function... If I am writing this code in single program, it works perfectly...but smart programmmer guide says write in compact form. So with user defined function this is not …

Member Avatar for Prabakar
0
94
Member Avatar for oceanaut

HOW to develop a program that plays the game of Mastermind by C programming? The Game of Mastermind Mastermind is a simple code-breaking board game for two players, i.e., a codemaker and a codebreaker, invented in 1970 by Mordecai Meirowitz. The codemaker secretly creates a code consisting of four colors …

Member Avatar for jephthah
0
2K
Member Avatar for emilio

i am trying to generate random numbers in a loop i wrote this function [code=syntax] int getRand ( int a , int b ) { static int x = 0 ; if ( x == 0 ) { srand ( time( NULL ) ) ; x++ ; } return a+rand()%(b-a+1); …

Member Avatar for emilio
0
103
Member Avatar for wsn

Hi, I'm writing a program where the user can enters numbers and these numbers are stored in a file, then the numbers are read from the file and a certain calculation is done to each number by creating a thread for each My problem is: The first problem is whenever …

Member Avatar for Salem
0
105
Member Avatar for apocrypha

Hi guys, I'm writing binary data to a file using fwrite. I can't get rid of '0x0D' whenever it writes '0x0A'. I use hex-viewer to check data. For example, if data is '0x01 0xFF 0x0A 0x0E', it writes '0x01 0xFF 0x0D 0x0A 0x0E' Is this because fwrite writes by byte, …

Member Avatar for apocrypha
0
34
Member Avatar for nilesh03

Hi... I'm currently doing a ludo game in C, I'm stuck with the pawn positions on the board. How do I manage the position of the pawns of each player, if I have maximum of two players and 4 pawns? Here is my code for the pawn position but it …

Member Avatar for Salem
0
246
Member Avatar for venumadhavkk

as we know that memory is very important in embedded systems which one is more effective either to use single linked list or Double linked list..even though DLL is more convenient it will consume more memory..

Member Avatar for Narue
0
156
Member Avatar for venumadhavkk

hai can we write a C program without using main()..if yes what is the other way of doing this

Member Avatar for Salem
0
26
Member Avatar for web_master

as we use \n for next line is there anyway to go back to the previous line if not then, is there anyway i can use the x,y coordinates of the runtime window. all the experts, Please Help...... Thanks.

Member Avatar for jephthah
0
3K
Member Avatar for wsn

Hi, I'm trying to create this program that does nothing until it's interrupted in the child, if the interrupt occurs then the parent should sent a SIGQUIT, so fare i have been stuck in an infinite loop =/ Any help is appreciated [code] #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include …

Member Avatar for jephthah
0
101
Member Avatar for Sleepwalker817

Hello, I need some help with the program below. [code] #include <stdio.h> float get_startingbalance(void); float getCntOfWithdrawls(); float getCntOfDeposits(); float getEachDeposit(); float getEachWithdrawl(); float checkBalance(); float calcAndDisplayBalance(); float displayBankRecord(); void print_withdrawalnumber(int num_withdrawals); void print_depositnumbers(int num_deposits); void print_startingbalance(float start_balance); void print_endbalance(float current_balance); int main() { /* Declare Variables */ int num_withdrawals, num_deposits, …

Member Avatar for Salem
0
346
Member Avatar for Firestone

Often in a code snippet, I will see [code] printf("%d %2d %3d", i,i*i,i*i*i); [/code] What does putting the numbers in front do, since it works the same without them? (ie) [code] printf("%d %d %d", i,i*i,i*i*i); [/code]

Member Avatar for JLChafardet
0
285
Member Avatar for mghx

Write a program and fill a queue with random numbers between 0 and 100. The size of the queue is assumed to be 15. After filling the array with random numbers, display the elements in the queue and remove the elements of the queue and store these numbers according to …

Member Avatar for Narue
0
186
Member Avatar for lavicool

HI, Following is a program to calculate resistance. Can u please tell me how to make the program loop again using a 'While' statement or is there anyother way to loop the progam. Now my program runs once. Suppose if i enter wrong values, it should not terminate but rather …

Member Avatar for mishraatul
0
151
Member Avatar for wsn

Is the difference between the execlp execvp calls and execl execv, is that execlp execvp have the advantage of specifying a file name instead of a path name what makes these two functions better to use over execl and execv?

Member Avatar for wsn
0
102
Member Avatar for Sh13

I feel really stupid by asking such question I have the following code [code] char choice; while( ( choice = MenuChoice() ) != 'QUIT' ) { PrintMenu(); { switch (choice) { case STRING: case 's': checkInput(strings); break; case QUIT: break: default: break: } } } char MenuChoice(void) { char menuchoice; …

Member Avatar for Sh13
0
139
Member Avatar for Platinumempire

I would like to know if you can measure execution time in nanoseconds - I have the following source code, however the time is measured in milliseconds. Help If You May ! [code=c] #include <stdlib.h> #include <stdio.h> #include <windows.h> #define NUM_ITEMS 500000 void quickSort(int numbers[], int array_size); void q_sort(int numbers[], …

Member Avatar for Ancient Dragon
0
242
Member Avatar for Sh13

Hi, I read in data from a file something like this in my main function text text texttext texxttet texet [code] char **array; ifp = fopen (filename.txt , "r");[/code] then I allocated some memory using malloc [code]for(i = 0; i < 3; i++) { array[i] = malloc(50 * sizeof(char)); } …

Member Avatar for Sh13
0
98

The End.