15,555 Topics

Member Avatar for
Member Avatar for 9tontruck

Hi, I have some questions about multi pipe. First of all, What I should do is making 6 child processes and each of child process reduces a global value (by 1) which is saved in malloc concurrently until the value reaches 0. All I could find from google was about …

Member Avatar for gerard4143
0
183
Member Avatar for rje7

[code=c] printf("\nn = %*d", 5, 4); [/code] and the output is: [code]n = 4[/code] (yea! there are spaces between = and 4) if i am providing only one argument 5 instead of 5 and 4 i get an error stating too few arguments. What in the world is the "*" …

Member Avatar for rje7
0
226
Member Avatar for trebor09

#include <stdio.h> #define p printf #define s scanf int program,Y,N; do { p("Choose from the following program\n"); p("1 for program no.1"); p("2 for program no.2"); p("3 for program no.3"); p("4 for program no.4"); p("Continue (Y or N)?"); repeat = getchar(); putchar('\n'); }while(repeat == 'Y' || repeat == 'N'); } program1() …

Member Avatar for trebor09
0
251
Member Avatar for Goshutu

Hi,I have tried to get this program to work,but it works to the moment when you enter some of the array`s numbers and then crashes.In different sizes of the matrix you can enter different number of numbers,but for instance when the matrix is 5x5 the program crashes after the 11th …

Member Avatar for Goshutu
0
448
Member Avatar for onus

I am making a program to do a breadth first search. The code which I am posting here just makes a que of the nodes visited in a binary tree in inorder fashion,so this implementation is not yet complete. While developing I got a segmentation fault which I was not …

Member Avatar for Martin B
0
158
Member Avatar for NotAround

I'm rather new to the C programming language and I'm very stuck. Whenever I try to assign a value to dynamically allocated string, I end up with a Segmentation Fault. Could someone help me by explaining why this happens. Following is a bit of my code that I think should …

Member Avatar for gerard4143
0
148
Member Avatar for halil.burak
Member Avatar for halil.burak
0
133
Member Avatar for yabuki

I created my own header file in C by creating the ff. files: myfile.h, myfile.c and main.c.Afterwards, I compiled myfile.c so I already have the object file for it, but the problem is when I compiled and run main.c this error message appeared: "Undefined symbol _sum". Please help me to …

Member Avatar for xmelx
0
380
Member Avatar for gahhon

i wanna ask about this statement... [CODE]int a[] = {0};[/CODE] the value all of a is it equal to 0 ? i mean all of the location of a..

Member Avatar for halil.burak
0
89
Member Avatar for gaurav_13191

This is my code for drawing a circle using mid point algorithm:- [CODE] //Midpoint circle algorithm #include<graphics.h> #include<stdio.h> #include<conio.h> void drawcircle(int xc,int yc,int r); int main() { int gdriver=DETECT,gmode; initgraph(&gdriver,&gmode,"..//bgi"); drawcircle(250,250,10); getch(); return 0; } void drawcircle(int xc,int yc,int r) { int p,x=0,y=r,incr1=2*x+3,incr2=incr1+2-2*y; void drawPixel(int,int,int,int); drawPixel(xc,yc,x,y); p=1-r; while(x<=y) { if(p<0) …

Member Avatar for Adak
0
129
Member Avatar for xcr

Hello all, I hope that someone can help me with this, I am trying to add an element to a dictionary, and in order to do such, I am using a binary search mechanism to find the correct place in the dictionary. My code compiles fine, but when I run …

Member Avatar for Unimportant
0
90
Member Avatar for R3Slick

Ok this is so new to me but does anyone have example code that decodes header fields in an IP datagram? or a link to something like the beej's guide....So i need to decode the header from the following example. 0000000 141724 120662 000002 000004 000000 000000 000000 000000 0000020 …

Member Avatar for Pral
0
3K
Member Avatar for Oakley & Ooijer

can anyone pls help me to solve tis Q? the objective is :To utilize string handling and file handling capabilities in C programming. Task : 1. Develop a program that will receive a single string which shall have a minimum length of 10 characters long. (Hint: Use function called strlen …

Member Avatar for Narue
0
96
Member Avatar for tweetychelz

Imagine a tollbooth at a bridge car passing by the booth is expected to apply a fifty-cent tool. Mostly they do, but sometime a car goes by without paying. The tollbooth keeps track of the number of cars that have gone by and of the total amount of money collected. …

Member Avatar for peter_budo
0
299
Member Avatar for patticus

I'm trying to solve a sudoku checker for a game I'm building in C. Essentially these nested for loops are supposed to check through the smaller boxes of 9 numbers to ensure there are no duplicates. Unfortunately, the continue seems to make the checker not work. :( 123 456 576 …

Member Avatar for thelamb
0
90
Member Avatar for Alerwiali

hi Everyone !! i need help guys with hash table in c ..could anyone help me by a little explaination of how to use hash tables ...please give examples.. Thanks in advance for all.

Member Avatar for Alerwiali
0
132
Member Avatar for diddle

Hi all, Could you tell me how to write simple graphics program in c, for example, how to take the format of bmp, pgm, csd file from image file? how to convert from one format to other? If anybody knows a good book or web site, please tell me soon.

Member Avatar for Ancient Dragon
0
358
Member Avatar for starkz_123

[CODE] #include<stdio.h> #include<math.h> #define min(a,b) (((a)>(b))?(b):(a)) #define abs(a) (((a)>(-(a)))?(a):(-(a))) void convert( int bod, int *x, int *y, int *z ) { int a; int b; int c, str, zb; if( bod==1 ) { *x=0; *y=0; *z=0; return; } a=(bod-2)/6; b=(-1.0+sqrt(1+8*a))/2.0; c=bod-1-3*b*(b+1); ++b; str=(c-1)/b; zb=c-str*b; switch( str ) { case 0: …

Member Avatar for digital29
-1
224
Member Avatar for oggiemc

Hi, Can someone explain to me what is going on in the code below as im new to pointers and not quite sure what is going on..In particular, an explanation of the first couple of iterations in the for loops would be helpfull.. Thanks [code=c] #include<iostream> 5 using namespace std; …

Member Avatar for gerard4143
0
76
Member Avatar for ricardo.crudo

Is necessary deallocate memory of pointer-to-pointer? Example: [CODE] my_type_t **example; example = (my_type_t **) calloc(10, sizeof(my_type_t *)); for (i = 0; i < 10; i++) { example[i] = (my_type_t *) malloc(sizeof(my_type_t)); } // ... free(example); // it enough? // Or is necessary do this... for (i = 0; i < …

Member Avatar for gerard4143
0
86
Member Avatar for xinyonz
Member Avatar for shinichi78
Member Avatar for Narue
0
31
Member Avatar for antikceo

Hi, I have the following code that is meant to serve as a t9 program like the one in mobile phones. It initially loads a dictionary file, stores the values in a dictionary, and prompts the user to enter a string of numbers between 2 and 9. For some reason …

Member Avatar for antikceo
0
1K
Member Avatar for Akulki
Member Avatar for caraie

Hi!, im new in this forum (and programming in c :)) (and sorry, my english is not good enough, I speak spanish) I have a problem trying to release memory from a Matrix structure. When I try to release a square matrix there is no problem, i can do it, …

Member Avatar for Martin B
0
121
Member Avatar for mast3rshan3

Hello everyone, I'm just getting started with C and I need help on this problem. It's a pretty long read so bare with me. [QUOTE]Objectives 1. To reinforce your knowledge of ‘for’ loops and ‘while’ loops 2. To utilize strings (character arrays) in C 3. To implement logic in your …

Member Avatar for NuclearSheep
0
675
Member Avatar for Danny_501

Hi all, Is there a way to make thread pools in POSIX pthreads? (using c) I could only find implementations for java and c++, but I need it to be in c. Thanks.

Member Avatar for gerard4143
0
161
Member Avatar for randyson

i want to do a program to implement time table preparation program using c language.i need some help to how i should write codings,necessary fields.i dont have any idea to start.so i need some examples that i have to compare with that and to try myself

Member Avatar for halil.burak
0
543
Member Avatar for wallace900402

i know how to use fopen to read a file, but i have a changing file name like this "p%dt%03d.state" where the variables are changing inside a loop. eg : p1t001.stae, p1t002.state ... etc how will i be able to do that? thanks!!

Member Avatar for Ancient Dragon
0
41
Member Avatar for angelinrajeesha

Hi, i have the following code not able get the output #include <stdio.h> #include <string.h> #define DELIMITER "," int main() { char *bufferPtr = " \"Angelin\",\"rajeesha\""; char *delimiterPtr =NULL; int parseIndex = 0; char ** fieldarray; fieldarray[parseIndex] = bufferPtr; parseIndex++ ; delimiterPtr = (char *)strstr(bufferPtr, DELIMITER); printf("\n delimiterPtr %s\n",delimiterPtr); bufferPtr …

Member Avatar for Ancient Dragon
0
100

The End.