15,551 Topics

Member Avatar for
Member Avatar for edek

[CODE=C]int test[2]; pipe(test); FILE *to, *from; if ((to = fdopen(test[1], "w")) == NULL) return 1; //error: could not create stream if ((from = fdopen(test[0], "r")) == NULL) return 1; //error: could not create stream fputs("test text", to); char testBuff[5]; fgets(testBuff, 5, from); puts(testBuff); //This should display 'test' in console - …

0
56
Member Avatar for natd

I am having trouble reversing the words in a sentence. For example "a line of text" should be printed "text of line a". So far I can only print the last word, it is probably obvious but at the minute i just can't see how to do it. Any help …

Member Avatar for natd
0
808
Member Avatar for sahil_itprof

Can any onbe say me the exact difference between a pointer (*p) and the array p[]???? I mean to ask that when we pass an array to a function by reference, we can have both in the function definition, the * or we can manipulate the array too... But there …

Member Avatar for Aia
0
177
Member Avatar for Ryano24

I am trying to do a program that produces random limericks and this is what I have so far... I am posting this again, because I don't think the first one went through. Sorry if it did... #include <stdio.h> #include <time.h> #include <stdlib.h> #include <string.h> #include <ctype.h> int main(){ char …

Member Avatar for jephthah
0
88
Member Avatar for guvengunes

Write a function that fills in a given matrix with the given numbers so that the sum of all columns and all rows should be equal to the same number. The prototype for the function should be void fillMatrix(int mat[][MAXSIZE], int numbers[], int rowSize, int colSize, int sum); For example, …

Member Avatar for jephthah
-4
95
Member Avatar for rock_rocks

Hi all, I have read an YCbCr image by using fopen, fread using C. I wanted to extend this to read multiple frames like in a Video. How should I proceed? I should take a while loop, but then what is the limit of the counter. After reading those images …

Member Avatar for jephthah
0
113
Member Avatar for fredmac

I need help changin this program around right now it tellls rather the number is prime but i need to make the program tell rather the user puts in is even or odd heres a lil code let me knw if i need to put all the code on there …

Member Avatar for jephthah
-1
83
Member Avatar for samush

The problem is that my program crasches when at line 13. Pot10 i an int and lgth is an int so whats the problem? I can't figure it out:( [CODE=c]typedef struct ArrInt{ int intM[100], lgth; } megaint; void scanMeg(megaint *x){ int Pot10 = 0, ret,IntArr[100]; char c; while( (c = …

Member Avatar for Salem
0
218
Member Avatar for cbrown153

Hi everyone, I'm new to C programming and I'm trying to write a program that can print text in columnar format with a maximum width. I've been trying with this but I get a seg fault. Am I going about this the right way? Any help would be really appreciated. …

Member Avatar for Aia
0
65
Member Avatar for hobbsalex

Hi there, I'm having a problem with adding a data structure to an existing linked list that has highlighted a gap in my knowledge about the latter. Briefly, what I am trying to is add a 'particle' to the end (i.e. appending) of an existing linked list of particles. My …

Member Avatar for Salem
0
91
Member Avatar for tah

Hi Sir Write a C program to count and print the total number of: upper case letters, i.e. ‘A’ to ‘Z’ lower case letters, i.e. ‘a’ to ‘z’

Member Avatar for jephthah
0
227
Member Avatar for emilio

hello i am trying to figure out the output of this specific code [CODE]int main() { int i , parent_id , ans ; parent_id = getpid() ; for ( i = 1 ; i <= 5 ; i++ ) { if ( getpid() == parent_id ) { ans = fork() …

Member Avatar for emilio
0
450
Member Avatar for sjgriffiths

Hello char **pOutData; /* Output results */ char *ptoken I have a pointer which contains the following hdjhasdjkhasd;stephenjohnson;647823463;dhasdjhaj I want to work through and get out just stephenjohnson I have the following so far, which does not work....any help? [code=c] for ( size = 0; size < b2b_data_drill_nNoSelect; size++ ) …

Member Avatar for Ancient Dragon
0
144
Member Avatar for SonxQ7

Hi all, new here so have 1 question... Am wondering this forum has a section for Windows Programming discussions

Member Avatar for Ancient Dragon
0
85
Member Avatar for melystar

Hello, I'm still getting the hang of coding (just started a few weeks ago) so this may seem like a daft question. I keep on getting three errors when I run my code: ode_functions.c f:\ode_functions.c(41) : error C2296: '^' : illegal, left operand has type 'double' f:\ode_functions.c(41) : error C2297: …

Member Avatar for Nick Evan
0
179
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
120
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
198
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
113
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
197
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
86
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
81
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
213
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
93
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
145
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
276
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
107
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
231
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
265
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
141

The End.