15,548 Topics

Member Avatar for
Member Avatar for akaicewolf

Alright so I am trying to insert nodes into a linked list but also I want them to be sorted right away I think I got most of it except I am struggling when it comes to inserting it to the middle of the table temp -> price = price; …

Member Avatar for akaicewolf
0
125
Member Avatar for jodzjcm

if( strcmp(z->Rev->x.y,z->x.y) > 0) In this statement i want to swap the pNext and pPrev. How will be the assignment look like?

Member Avatar for Ancient Dragon
0
94
Member Avatar for jodzjcm

How to sort alphabetically the link list? Example: pHead B pSecond A pLast C Result: pSecond A pHead B pLast C

Member Avatar for Ancient Dragon
0
223
Member Avatar for jodzjcm

I have a problem. If the text is too long in the text file...the program crashes. How to solve it?

Member Avatar for WaltP
0
146
Member Avatar for jodzjcm

If the user inputs 1 the program will automatically create a new node..How? the maximum that I can do is 2..how to add node? Code blocks are created by indenting at least 4 spaces ... and can span multiple lines def *New(def *pHead){ def *temp; temp = malloc(sizeof(def)); pHead->pNext = …

Member Avatar for TrustyTony
0
147
Member Avatar for hwoarang69

hi i need help with linked list. so iam trying to mege two linked list together. i got all to working but my meger method dont work. lets say age of List_A = 1, 2, 3; and List_B = 2, 4, 5, 6; after meger method i should get 1,2,2,3,4,5. …

Member Avatar for zeroliken
0
159
Member Avatar for abhiroop11

i am using gcc 4.4.3 on ubuntu 10.4 32bit machine. i use 'gdb' to debug my code. Since few days i am seeing that whenever i debug code gdb steps into the c library functions used in the code also(like printf,fgets etc). This shows a long list of calls from …

0
124
Member Avatar for jodzjcm

It doesn't read the first line of the text file. Why? pFile = fopen(user, "r"); if(pFile == NULL) printf("File doesn't exist!\n"); if(pFile != NULL){ while(fgets(line,80,pFile) != NULL) { fgets(search,1000,pFile); printf("%s\n",line); . . . . .

Member Avatar for zeroliken
0
127
Member Avatar for ineedsomehelp:3

I need some help with debugging this problem. I just started learning how to store files at C but I can't seem to check if this code is correct since I can't compile it well. Might anyone help me point out the problems in my code? #include <stdio.h> #include <stdlib.h> …

Member Avatar for zeroliken
0
234
Member Avatar for afzal123

anyone can help me. all of this overcome the segmentation fault. #include<stdio.h> int bubble(int*,int); void filewrite(); void avgmarks(); void fileprint(); void filesort(); void rollin(); int main(void) { int marks[100],rollno[100],x[100],n,i,j,roll,c,mark,roll1; char name,nam; while(c!=6) { printf("GIVE CHOICE--\n"); printf(" 1 TO ENTER STUDENT INFO.\n"); printf(" 2 TO SEE STUDENT.TXT FILE\n"); printf(" 3 TO …

Member Avatar for histrungalot
0
154
Member Avatar for dinesh17

i'm working on a project in ma college ....i'm in need of accessing the process information ofa system to simulate them ! i don't know how to access the pcb of the os !! please help me

Member Avatar for BobS0327
0
574
Member Avatar for SavemeEddie

cant get it to play crrectly What is my error? include <stdio.h> void displayBoard(char [3][3]); int main() { int player = 0; int winner = 0; int choice = 0; int row = 0; int column = 0; int line = 0; char board [3][3] = { {' ',' ',' …

Member Avatar for Adak
0
155
Member Avatar for tischn

Hi All I am programming a Black Jack. I made a procedure to calculate the Score of the Cards. Here is the code: int calculatescore (int* spieler, int i0) //Der Score wird berechnet { int ausgabe; int i1; int i2; for(i1=0; i1!=9; i1++) { if(spieler[i0][i1]!=0) { i2=spieler[i0][i1]%13; if(i2>=10) { ausgabe=ausgabe+10; …

Member Avatar for L7Sqr
0
305
Member Avatar for ttrrp

Hello everyone, i am facing a problem with turbo c, when i complie and run the program, the screen just shows a blank black sreen, nothing is executed. you press any button on keyborad, the screen returns back to the editor mode. No program is getting executed, Found no errors …

Member Avatar for ttrrp
0
228
Member Avatar for chrlop

Hi I was ask to do a code in c wich read the contenent inside a txt file and display it then after display it they wan't me to tokenize those command and interpretate them in c. I have no experience in c if someone can show me how to …

Member Avatar for chrlop
0
891
Member Avatar for hwoarang69

hi i really interest in C game programming. i looked online for tutorials but they seem confusing. I am using c for one year, but i have no knowledge of game programming. could any one tell me where should i start and what is the best language for game programming. …

Member Avatar for Tumlee
0
172
Member Avatar for zingwing

I was told to use bubble sort to sort the arrays. what i need to do is read in one array and have to sort into the other array but i haven't been able to figure it out here's the code i have so far. i've been trying to manuplate …

Member Avatar for Ancient Dragon
0
195
Member Avatar for hwoarang69

I am so confused on how to tell a run time of a algorithm. so i came up with some ex for me to understand. could any one tell me if i am find the run time right plz. ex1 - run time for this loop is O(n)? bc it …

Member Avatar for hwoarang69
0
150
Member Avatar for terrah

ok so I had to do a program that represents numbers from different radix to some other radix... The part I got stuck is the following: i.e. I want to convert 123.625 (radix 10) to radix 3. The output is 11120.1212121212121212..... any ideea of a pseudocode/C code to detect whenever …

Member Avatar for gusano79
0
137
Member Avatar for MicrosoftMahmou

hi Am trying to write a C-code that multiply two matrices but i want the elemnets of every matrix is random number using time function main() { srand ( time(NULL) ); int m1[10][10]; m1[10][10] = rand() % 10; scanf("%d%d",&r1,&c1); scanf("%d%d",&r2,&c2); if(r2==c1) { . . . . } this is the …

Member Avatar for zeroliken
0
226
Member Avatar for tauqeer ahmed
Member Avatar for km2011

Hello everyone!! I have a problem about memory allocation, i use calloc() to initialize all elements in array to be zero. This is my code: #include <stdio.h> #include <conio.h> #include <stdlib.h> #include <time.h> #define sizes 1200 main() { double** arr; int m[sizes]; int i,j,k; srand((unsigned)time(NULL)); arr= (double **) calloc(sizes,sizeof(double*)); for(k=0; …

Member Avatar for km2011
0
176
Member Avatar for zingwing

i need help finding the low value in an array after reading file with numbers. With my program I am to assume that the size an array is 100 even if only 10, 31, 50 spaces are taken up. The problem im running in to is when i iniztialize the …

Member Avatar for Adak
0
227
Member Avatar for TheOnlyRoss

Hello. I am trying to accept a paragraph from the user in C using codeblocks. But, with the scanf statement, the program stops accepting once i hit space. Is there some way to get around this problem?

Member Avatar for zeroliken
0
198
Member Avatar for hwoarang69

I am trying to compute 2x-x+4x, so the answer should be 5x. but i am not sure how to get started. The "x"'s are messing me up. I am thinking of using for loop and replace x with '\0'. and than add or sub starting from left to right. but …

Member Avatar for TrustyTony
0
107
Member Avatar for yamigx

hi.. lately i had this problem when i try to build in codeblocks.. Debug" uses an invalid compiler. Probably the toolchain path within the compiler options is not setup correctly?! Skipping... Nothing to be done. and i tried to install it again and again with different versions.. but it still …

Member Avatar for sergent
0
99
Member Avatar for newbie14

Dear All, I am trying to write to a file as below. But my file shows empty what could be wrong here? const char *dataFileName = "data.dat"; FILE *ftdata = fopen(dataFileName,"a+"); fwrite("TEST",1,2,ftdata);

Member Avatar for Tumlee
0
81
Member Avatar for Newbienoob

Hello.Got a problem with a binary tree again,i have made a visual printing but the problem is that it prints only completed tree,so if it is not full it crashes,is there a posibillity to add some extra print to value NULL,so after one right or left leave won't have value(NULL) …

Member Avatar for Newbienoob
0
177
Member Avatar for varunme

How can we convert a string to int without a standard lib the string termination can be '/r'

Member Avatar for Fiverivers
0
232
Member Avatar for hwoarang69

i need help with merge sort. struct List_A { int data; struct List_A *next; }; struct List_A *head; void merge_sort(struct List_A *); int main(void) { ....lets say i have a list build --- (list_A = 4,3,2,5) merge_sort(List_A); } void merge_sort(struct List_A *head) { struct List_A *cur_one; struct List_A *cur_two; if(head …

Member Avatar for Ancient Dragon
0
114

The End.