15,551 Topics
| |
Operating System Used:Ubuntu 11.04 Compiler Used: GCC Program related files:[Git Hub Link][1] I'm trying a implement program which will do a job, same as that of CPP (The C preprocessor) when I compile a .c file. In this particular code Copy_file_to_buf function not copying the whole file into the buffer. … | |
Hello, I was having some trouble related to a code. I wanted to pass a 2-D array as argument to a function,but I'm getting an error saying 'Expression Syntax in function Main'. I am trying to do it like this :-> void input(int **a[][10],int b,int c) { int i,j; printf("\nEnter … | |
Hi, Kindly I hope that I can find help regarding reusing of scanf. If the user should enter only integers not floats and the scanf is within a for loop. how can I force the program to continue normally when EOF happens as a result of wrong input? Example: int … | |
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; … | |
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? | |
How to sort alphabetically the link list? Example: pHead B pSecond A pLast C Result: pSecond A pHead B pLast C | |
I have a problem. If the text is too long in the text file...the program crashes. How to solve it? | |
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 = … | |
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. … | |
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 … | |
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); . . . . . | |
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> … | |
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 … | |
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 | |
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] = { {' ',' ',' … | |
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; … | |
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 … | |
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 … | |
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. … | |
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 … | |
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 … | |
| 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 … |
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 … | |
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; … | |
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 … | |
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? | |
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 … | |
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 … | |
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); |
The End.