19,876 Topics

Member Avatar for
Member Avatar for fredmac

This suppose to be a simple coin toss program that tells when the coin is fliped it reads heads or tails and this is wat i got so far #include <stdio.h> int example (int h,int t ); int main() { int x1, x2; int x; printf(" Enter 5 to run …

Member Avatar for jephthah
0
203
Member Avatar for Sh13

I am trying to add values that I read from input file using fscanf. There are 15 float values that were read from .txt file. Im copying some of the code here [code=c] #define MAX 15 for (i = 0; i < MAX; i++) { fscanf(ifp, "%f", array[i].miles); } [/code] …

Member Avatar for Sh13
0
119
Member Avatar for Cbeginner_us

This is a question for all people who know about Digital Communications, coding and decoding. Please I need to know how can I implement a (24,12) Golay Code in C. ( if you cant help me with the Golay code, I need to know about any block codes). Thank you.

Member Avatar for Cbeginner_us
0
203
Member Avatar for Sh13

Hi, I am supposed to read data from an input file with following information 16 //number of destinations// Baltimore //origin city// MD //origin state// Lewes //destination state// DE //destination state// 117.0 //miles b/w previous location and and this one// 160 //estimated driving time// Ferry //place to visit in that location// …

Member Avatar for jephthah
0
94
Member Avatar for jade09091990

[code]how to validate alphabet character input? for example, i have these choices: a, b, c, d,,, the program will run but erratic. for example you've entered "d3" , how to solve this problem?[/code]

Member Avatar for Salem
0
56
Member Avatar for bballa99

Game: Ragnarok Online Emulator: eAthena Code: C Programming SVN: [url]http://svn.eathena.ws/svn/ea/[/url] Okay so I am trying to create a mod for this game. It requires a source code edit to get it working, but I can't seem to make it work. There is this pet system called homunculus, and I am …

Member Avatar for jephthah
0
84
Member Avatar for SofMy

I can't run the programme, please assist to check the error. Thank you in advance for your assistance. Question: 1. Develop an application program that creates a list of integer test score value in an array, sorts the array in increasing order and searches it for a test score value. …

Member Avatar for Salem
0
216
Member Avatar for marquis1431

how do i keep track of the values entered so far so that i can get hte average in the display grade function? i.e. all scores entered so far... [code] #include <stdio.h> #include <stdlib.h> #define TRUE 1 #define FALSE 0 #define SENTINEL -1 int getGradeValue(int, int); void displayGrade( int, char); …

Member Avatar for jephthah
0
95
Member Avatar for samush

I have a problem with unsigned long long int's. I'll tried to do a function wich calculates the factors of an integer. It worked fine with int, but when an tried with unsigned long long int the % and <= operation failed... here is the surce code for the function …

Member Avatar for samush
0
150
Member Avatar for usaxray25

Hey guys-- I have been lurking on here for some time as a C++ student. I have a project to complete using cstring and strcpy() as a function within a "simple" program. The psedocode goes as follows: --program accepts 2 string array inputs(using getline) 40 total chars for str1 and …

Member Avatar for usaxray25
0
147
Member Avatar for shadow_shooter

What I'm trying to do is creating a structure array and pass it to a function. My function takes it as a pointer. But I'm having lots of errors which makes me mad. My deadline is approaching and still I've been trying to sort out what the problem is (for …

Member Avatar for Aia
0
280
Member Avatar for edek

I have (in main()) something like: [CODE=C]int toChild[2], fromChild[2]; pid_t pid; //Creating pipes: if(pipe(toChild) != 0){ return 1; } if(pipe(fromChild) != 0){ return 1; } //Forking: if((pid = fork()) == -1) return 1; if(pid == 0) {/* CHILD */ close(toChild[1]); close(fromChild[0]); //create streams: (they are not used in this example) …

Member Avatar for edek
0
109
Member Avatar for shadow_shooter

Hi, I want to scan a word from the user and store it in a char pointer. But I couldn't do it. The thing I just want as the following: char *word; scanf("%s",word); but, it doesn't work... please help for this simple problem. it sounds a bit noob, i know...

Member Avatar for Salem
0
2K
Member Avatar for nelledawg

Hi guys, I've got the code all written but there are a ton of runtime errors that need to be fixed, mainly with calculations and inputting data into the array. I also need to use pointers when referencing the scores array, and I cannot for the life of me get …

Member Avatar for Aia
0
235
Member Avatar for teffie

Hi, Im new to these forums and i need help with this application. Application Requirements In this application you are to create a Three Shells Game. In this game there are three cups or shells that are upturned. For each new game the pea is placed at random under one …

Member Avatar for JerryShaw
0
105
Member Avatar for it2051229

I'm creating a simple C# program that deals with pressing the DELETE key button in the keyboard. so what I created a key press event, but seems like the delete key doesn't work.. i tried it with other keys and it's working fine... why?? and is 46 the keycode for …

Member Avatar for Jx_Man
0
2K
Member Avatar for nelledawg

Hey guys, I'm trying to work on this switch menu and I'm not sure how to call a function with parameters from a case statement. Here is the code for my program so far (not finished with the actual program... Just need help with calling functions from the menu, so …

Member Avatar for nelledawg
0
268
Member Avatar for digiman

Hi Guys, I am trying to read each line from a file into a Sybase database table. I'm trying to implement string tokenization so i can format each field correctly because i was getting datatype violations :S The code I have is: - [code] if ((infile=fopen("datafile","r")) == NULL) { printf("Unable …

Member Avatar for Ancient Dragon
0
144
Member Avatar for wonder_laptop

Im taking an operating system course. i understood the code that solved the consumer - producer problem using semaphores. but what i didnt understood is where do we use these codes...what kind of processes uses this code ?

Member Avatar for Salem
0
105
Member Avatar for awoc

The following steps describe how to derive the approximate area of x^2: 1. Determine how close the approximate area needs to be to the true area (tolerance): User Specified Accuracy Difference is LESS THAN accuracy = 1 0.5 X 10-1 = 0.05 accuracy = 2 0.5 X 10-2 = 0.005 …

Member Avatar for Salem
0
85
Member Avatar for programmer321

Hello, I have written a test code for signal handling. The code is compataable for both Windows and Linux. The code is as: [code=c] #include <signal.h> #include<stdio.h> #include<string.h> #include <sys/types.h> #ifdef WIN32 #include <windows.h> #else #include <unistd.h> #endif void intr_hdlr(void); void intr_hdlr2(void); int cnter=0; int sig_cnter=0; int main () { …

Member Avatar for programmer321
0
175
Member Avatar for JFBiomed

I've got some fairly expansive code for musculoskeletal simulations that I'm altering. I've double and triple checked my code segments, but I've been banging my head against this particular error for some time. I'd appreciate any elucidation you kind fellows can pass my way. If any further code, etc would …

Member Avatar for JFBiomed
0
244
Member Avatar for rok92

Hi Guys, So I am trying to use C++ and openGL to create a simple robot arm that will follow a traget on the screen. I am to use Inverse Kinematics and more specifically the Cyclic Coordinate Descent Algorithm. I have found a few different ways to implement this although …

0
49
Member Avatar for electromania

In the below code im getting a year from the user. but when I print of the year from scanf is doesnt print the correct value such as 2010 will be printed as 74.43434 (somthing like this). If i change the scanf from %.3lf to %f or %d the program …

Member Avatar for electromania
0
86
Member Avatar for shadow_shooter

Hello everyone, I'm working on a project, each time two numbers are read from a text file. Text file contains two lines of sequational numbers, something like this: [ICODE] 4 5 2 1 10 8 3 4 6 1[/ICODE] I have two linklists and each node is able to store …

Member Avatar for shadow_shooter
0
304
Member Avatar for Taker

[code] #include <stdio.h> struct places { char places1[100]; char places[10][10]; int distances[10][10]; }; main() { int menu; char userinput1[10]; char userinput2[10]; char userinput3[10]; int cost; int other; int a; int b; int c; int distances; char places[50]; struct places names[10]; FILE *fp; /*creates a file pointed named fp*/ /* reading …

Member Avatar for Taker
0
233
Member Avatar for usman_2x

Hi Guys, I'm new to C and OpenCV, my postgraduate project requires me to find different body parts in an image, like legs, hands and torso and head. And then determine if the person is lying on the ground or standing upright. Please help if you have some ideas. Thanx

Member Avatar for Nick Evan
0
104
Member Avatar for electromania

Hi All, I've written a program, it has a main and lots of functions. Now i need to make a project from the code. Could some tell me what to do. I want a main.c a misc.c and misc.h. Which parts of the program would go in each one? Thank …

Member Avatar for Nick Evan
0
40
Member Avatar for MaestroRage

Hello again! Today's problem is one that is bothering me. My research into it has once again gone to waste, so I hope somebody here can help me understand why this is happening. The problem is everything is working honky dory, however I find myself having to enter the same …

Member Avatar for Aia
0
147
Member Avatar for yoas

Hello... i want to grab the currency value from bloomberg, this is a part of bloomberg html. I want to get USD-SGD value, in this time the value is 1.5198. How can i grab it using c language? please help me, because after this, i will translate to dynamic c... …

Member Avatar for Omarcito
0
117
Member Avatar for LadyPersia

Goldbach's conjecture in mathematics is that every even integer number greater than 2 can be expressed as the sum of two prime numbers. Write a program that prompts the user for a number, checks that it is positive and even, and prints the two primes that sum to it. First …

Member Avatar for jephthah
0
972
Member Avatar for Hodson

I have managed to concur bubble sort, quick sort and heap sort but I've got stuck on pigeonhole sort. I haven't been able to find much on the internet about it. I have wrote some code for it but it doesn't seem to work. I was wondering if any of …

Member Avatar for Hodson
0
326
Member Avatar for Spaiz

I wasn't sure where to put this topic, web or software development... The questions is this: is there a way to build a website with C? (not PHP calling C application) I read the web for a couple of days now, but I can't really find any explanation how to …

Member Avatar for jephthah
0
58
Member Avatar for TheSmokey777

Greetings, I need help with a Simple C program. I have to take input data such as this : Write a C program that will process a series of "words" entered by the user. A word (for the purpose of this assignment) is defined as a sequence of non-white-space characters …

Member Avatar for jephthah
0
105
Member Avatar for fredmac

write a function [I]multiple[/I] that determines for a pair of integers whether the secone intger is a multiple of the first. The function should take two intger arguments and return 1 (true) if the second is a multiple of the first, and 0 (false) otherwise. Use this function in a …

Member Avatar for jephthah
0
108
Member Avatar for fredmac

parking garage charges a $2.00 minimum fee to park for up to three hours. The garage charges an additional $.50 per hour for each hour or part thereof in excess of three hours. The maximum charge for any given 24-hour period is $10. Assume that no car parks for longer …

Member Avatar for jephthah
0
349
Member Avatar for shadow_shooter

Hello everyone, I'm working on a project which I should read from a text file. Text file contains two lines of sequational numbers, something like this: [TEX] 4 5 2 1 10 8 3 4 6 1 [/TEX] In the program, I need to find out where exactly a new …

Member Avatar for shadow_shooter
0
119
Member Avatar for M&M

I keen to write a program that reads a text from a file. Then i have to take each word from the text and change the word. If the word begins with a vowel, add the string "yay" at the end of the word. If the word does not begin …

Member Avatar for Ancient Dragon
0
97
Member Avatar for Taker

I have wrote this program to do i of 6 thing to 1) Initialise: Read static data from a file and a) store in appropriate data structures at run time b) sort into alphabetic order for subsequent display in the grid. 2) Menu: A menu to support the following: Have …

Member Avatar for Taker
0
186
Member Avatar for edek

What I would like to do is to redirect stdout of some application, let say A to another application, let say B. All this from another external application (written in C). Any ideas?

Member Avatar for Salem
0
86
Member Avatar for El Duke

Hello Everyone, I am not that expert in coding, just coding on a level that helps me to implement some wireless modules /packets/ links/ etc.... I was wondering if we could implement AI search algorithms using C code, as an example, in this image: [IMG]http://planning.cs.uiuc.edu/img338.gif[/IMG] It is the Bidirectional search …

Member Avatar for El Duke
0
99
Member Avatar for bhaltulpule

I am relatively new to C. I need to use to convert values generated by an A to D converter (000h to FFFh) into floating point numbers. One way that this can be done is using the Float command as in x = (float) y. Is there a better way …

Member Avatar for Salem
0
112
Member Avatar for Swift7625

Hello All, I have been trying to convert a long long to a char buff and having problems. I have tried spintf, and some casting but still can not get the conversion right. Any help would be great! Steve

Member Avatar for Salem
0
429
Member Avatar for Gerritt

The code is working as I want it to. I am supposed to use pointer syntax, and this seems to me working. I just wanted to run it past some of the people who know what they're doing first. [code] /*===============================================================*/ void add() { int vala, valb, valc, count=0, bog …

Member Avatar for jephthah
0
113
Member Avatar for missileh

Hi..., I just wanted to ask what are the posible scenarios where we could use function pointers in C... If anyone out there has any example then please do tell me....

Member Avatar for jephthah
0
144
Member Avatar for Jryzac

Hello, Looking for assistance for a coding problem I am having. I need to find a character, write the following characters to console, and stop at a particular character. Example: I need to write all characters between the FIRST '(' and FIRST ')'. Example text to parse: (((Write now))) example( …

Member Avatar for Ramy Mahrous
0
66
Member Avatar for nelledawg

Hi guys, Ok so I need to use pointer syntax for the functions init-costs(), show-costs() and toUpper() in the following code. I'm still working on the first two, but I'm curious as to what needs to be done to the toUpper() function. I'm pretty sure I've already done the pointer …

Member Avatar for jephthah
0
115
Member Avatar for pralu
Member Avatar for jephthah
0
412
Member Avatar for soosai

hi there .. whats wrong with th e following code? [code=c] #include<mpi.h> #include<stdio.h> #include<math.h> void main(int argc, char **argv) { int rank, row, i, j,s,p ; int n; int oldrow,oldcol,newrow,newcol; MPI_Status status; int z; int delta_x,delta_y; int temp_map[60][40]; int map[60][40]; int col; z=oldrow,oldcol,newrow,newcol; temp_map=0; map=0; printf("pls enter the row value\n"); …

Member Avatar for Salem
0
160
Member Avatar for Drake

When using functions in C, i cannot seem to make my table of options apprear on screen. I have put it in but it will not appear. The options i have put in work fine, for example press 1 to calculate voltage. This works fine and the answer is given …

Member Avatar for Narue
0
144

The End.