18,490 Topics

Member Avatar for
Member Avatar for knight fyre

I just finished up the final touches on my C Project (at least I hope that's the last of them). Anyway, it's due Friday (10% of my overall grade) and I'd like to have some quick feedback (constructive criticisms and complements) before I had it in. It was suppose to …

Member Avatar for jephthah
0
146
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
217
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
150
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
240
Member Avatar for alwayshere

#include<iostream> #include<string> #include<stdio.h> using namespace std; int main(){ char s[100]; cout<<"enter the string :"<<endl; gets(s); //memcpy char a[100]; memcpy(a,s,strlen(s)+1);//here if we decrease bytes to be copied to a value less than length of s i.e.(strlen(s)), then s is getting destroyed ...some garbage value is coming cout<<" a : "<<a<<" s …

Member Avatar for dougy83
0
161
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
117
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
101
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
224
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
111
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
169
Member Avatar for esmeco

Hello! I need to implement a set greater than and a branch less or equal in my 16 bit ALU design,but I'm having many difficulties. I know that in a set greater than a>b equals a-b>0 ,but I don't know how to work out from that and implement it in …

Member Avatar for Colin Mac
0
120
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
302
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
126
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
251
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
288
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
167
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
126
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
102
Member Avatar for A.k

In Pentium Processors all the registers are 32 bit but segment registers are 16 bit & not changed why ? please answer me.

Member Avatar for Salem
0
64
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
203
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
257
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
108
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
329
Member Avatar for Nemoticchigga

Is there a way to cast a the contents of a char* buffer into an int?

Member Avatar for Nemoticchigga
0
92
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
254
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
120
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
44
Member Avatar for Rastafari

Hi I have a program that sleeps in user space for 10 seconds and im' tryin gto verify that the sleep is actually 10 seconds so I did something like this time1 = rtdsc(); sleep( seconds); time2 = rtdsc(); but i'm not sure what to do from this point forward... …

Member Avatar for eggi
0
154
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
164
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
130
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
1K
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
347
Member Avatar for amt_muk

Hi What are the basic differences between the methods atol() and strtol()? Regards, Amit

Member Avatar for amt_muk
0
466
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
82
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
120
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
114
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
363
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
140
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
110
Member Avatar for anshumm

Hi I want to automate the lrpd test which essentially involves inserting a few lines of code after every read and write inside a loop in a c program. Whats the easiest way to do it. Regards

Member Avatar for anshumm
0
91
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
197
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
114
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
132
Member Avatar for Member #304223

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
116
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
450
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
134
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
176
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
137
Member Avatar for pralu

[B]can any one tell me what is socket descriptor in socket programming in c.[/B]

Member Avatar for jephthah
0
452

The End.