15,551 Topics
| |
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 … | |
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 … | |
| |
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 … | |
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.. | |
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) … | |
| 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 … |
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 … | |
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 … | |
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. … | |
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 … | |
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. | |
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. | |
[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: … | |
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; … | |
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 < … | |
| |
can you help me how to convert US7ASCII into UTF-8 using C? Thanks ! | |
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 … | |
Please give an algorithm to know the memory size in bits......... | |
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, … | |
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 … | |
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. | |
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 | |
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!! | |
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 … | |
Hi, Please suggest me all possible ways of declaring structures in my C codes. I want to be able to create a structure which I can use in my methods without have to use the keyword "struct" each time to declare it. One way I already know of is : … | |
like the thread title said i need the best C book for never programmed person can you please tell me it thanks.... | |
Hello im confused with pointers, how do i create a shallow copy of a string array in c ? [CODE]char *currMenuArray; // ??? char *MainMenuArray[] = { "MAIN MENU", "One", "Two", "Options", "Quit" }; char *OptionsMenuArray[] = { "OPTION MENU", "Option1", "Option2", "Option3", "Back" }; void main() { currMenuArray = … | |
can you help me to answer this problem... A high building has 26 floors with the level 0 and the level 25 as the lowest and the highest level, respectively. It has a lift for transport the occupant to the level destination. The lift moves up and down in respect … |
The End.