15,550 Topics

Member Avatar for
Member Avatar for veereshcta

Hi, Here I have my code which exactly functions as nl command in unix. How can I replace my buffer using malloc which reads unlimited line length and where as my code reads 100 char per line. [code] #include <stdlib.h> #include <stdio.h> #include <string.h> #include <errno.h> #define MAX_LINE_LENGTH 100 //Prototypes: …

Member Avatar for Ancient Dragon
0
116
Member Avatar for myk45

Hello, [CODE] #include <stdio.h> int main(void) { const int j = 2; int i; switch (i) { case 1:break; case j:break; default:break; } return 0; }[/CODE] i tried executing the above code, and i got the following error: [B]error: case label does not reduce to an integer constant[/B] Well, since …

Member Avatar for gerard4143
0
86
Member Avatar for rizrash

Hey Friends i am new here !! Well i have a project in which i am required to make some good program out of the Tubo C book !! Now i was thinking of a Tic Tac Game or a Mathematical equation calculation program ! I`ve seen some examples here …

Member Avatar for Adak
0
2K
Member Avatar for saad749

My Object is to display a 24bit color .bmp picture in 24 bit colors via Turbo C Compiler. Turbo C can display only 16 colors so I will need to use a Windows Interrupt[or something like that] to display the image. I googled a lot but couldn't get a hint …

Member Avatar for Ancient Dragon
0
605
Member Avatar for hoganmadman

i have managed to write a program that reads an arbitrary number of integers less than or equal to 20 and finds the sum and average. i am now trying to write a bubble sort to order the integers from least to greatest but i am having problems. this is …

Member Avatar for Adak
0
127
Member Avatar for 1bh

Hi guys, So my code is below. This is a simplified version of the shell... It does not continue for ever... I guess its actually rather a program to accept a command.. has the fork and the execve etc. Anyways when i compile it and run it in the terminal …

Member Avatar for abhimanipal
0
237
Member Avatar for Hitman Mania

I have the equation 6a+9b+20c=n with n being the total number of McNuggets, and the "a" "b" "c" being the pack combos of McNuggets. Now, for n, there are different combinations that can be used to get n where n >= 6. [B][U]The problem asks that I should be able …

Member Avatar for Adak
0
167
Member Avatar for mi.mac.rules

I go to Rutgers, NB, and I'm taking a class that requires the use of C without teaching us much of C, so sorry if I'm a bit uneducated. My first question is, when using fgets(), how do I get the [B]next[/B] line? I have [CODE]while((fgets(line,MAX,file)) != NULL){[/CODE] to get …

Member Avatar for mi.mac.rules
0
2K
Member Avatar for hoganmadman

the basic idea of what im trying to do is write a program that reads an arbitrary number of integers less than 20. then it prints out the position of the integer in the order the user inputed it then it finds the sum when it scans a non integer …

Member Avatar for hoganmadman
1
142
Member Avatar for aiki985

Hi, I'm working on a project where I have a text file that needs to be parsed into assembler instructions. For example: 01364820,8D280000,FFFFFFFF will be parsed as: ADD $t1, $t1, $s6 LW $t0, 0($t1) I need help parsing the text file. I thought I would start by first reading the …

Member Avatar for aiki985
0
224
Member Avatar for titan5

I have to use a software package written in c with many different files. It has an executable file with a variable - cc=/usr/bin/gcc cc is later used in that file to compile other files present in the software. wenever i try to run this file I get an error …

Member Avatar for titan5
0
197
Member Avatar for USC_Megoy

Hi! Im a newbie here.... I got a problem with my program...My linked list is ok but everytime I export the data to the file, things don't work in a proper way..I will show my code...pls help me...thanks... [code] labname[20]="lab445.txt"; /****************FWRITE FUNCTION**********************/ void save_data(information *lab,char labname[]) { FILE *fp; int …

Member Avatar for Ancient Dragon
0
218
Member Avatar for arnas

I think I have a hard time understanding the return() statement. I have to make a program where a user gives the lower limit and upper limit as input. After that, the program should give all prime numbers that are between those 2 numbers. A testcase would be: input: 10 …

Member Avatar for Adak
0
162
Member Avatar for crapodino

Hi! i am trying to compile/link a simple application that uses a library called OpenDBX. I have already compiled and installed that library. Now, i am trying to do a simple client of it. The client (Prueba.c) is just like this: [CODE] #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <odbx.h> …

Member Avatar for vinodhkumarvk
0
323
Member Avatar for Whilliam

Example, n is 8. Merge sort (for link list) is constantly divide the list into two sublist until every node->next will point to null. Then, sort them by merging them. When I tried to count it myself, in the divide part first divide the 8 nodes into two. In link …

Member Avatar for Momerath
0
134
Member Avatar for Katya

Hi everyone![I] I need to write program that will find the average of 20 element array and also display the number of each number in the array occurs.[/I] [I]I have sorted average number but straggle with "number of occurrences". Please help!!!![/I] [code=c] #include<stdio.h> #include<math.h> main() { float avg,sum=0; int i,j; …

Member Avatar for alekhya.p123
0
531
Member Avatar for BlakTasTic

I am taking an algorithm class and haven't coded in c in around 5 years and realized I have forgotten alot. I tried to use atoi, i know there is a better function but for what I'm using it for and my lack of knowledge now it is simpler, for …

Member Avatar for WaltP
0
100
Member Avatar for Emaneitron
Member Avatar for neti1987

hi! I'm looking for things which compile on visual-studio, but not in the gcc compiler in the C programming language (C++ it's ok too). I have to make list of such things. If someone could send me link to such list or send me some examples, it will be great! …

Member Avatar for Ancient Dragon
0
122
Member Avatar for titan_amit

hiii guys.. i am trying to make an mp3 player using ADSP 21369 processor. For that i need a code which can convert mp3(mpeg2 layer3) samples to wave samples in c. thanx in advance.

Member Avatar for Inth
0
203
Member Avatar for unnamed17

#include <my_global.h> #include <mysql.h> int main(int argc, char **argv) { printf("MySQL client version: %s\n", mysql_get_client_info()); } I got the error when i try to compile the above code.

Member Avatar for Ancient Dragon
0
53
Member Avatar for unnamed17

Hello, I have a txt file of the following format: 315151,34.56,1,1,54442221,23344445 512512,12.54,1,1,23444442,45612345 I am using the following code to parse it and it works: while( fgets( output,sizeof(output) ,file) != NULL ){ i=0; token[i] = strtok(output,","); while( token[i] != NULL){ i++; token[i] = strtok (NULL, ","); } dec2bin(atol(token[4]),binaryBefore); dec2bin(atol(token[5]),binaryAfter); dec2bin is …

Member Avatar for Ancient Dragon
0
241
Member Avatar for zaacze

hi everyone! i've been trying to make a program regarding returning the number of characters with even ASCII codes. For example, if a user input ABCDE, the output should be 2 since B and D are of even ASCII codes. Here's what i've done so far... [CODE] #include<stdio.h> #include<conio.h> #include<stdlib.h> …

Member Avatar for Ancient Dragon
0
171
Member Avatar for unnamed17

I have a txt file in this format: 111,5.67,2,4,566666,666667 111,5.67,2,4,566666,666667 111,5.67,2,4,566666,666667 111,5.67,2,4,566666,666667 Is there any way so i can open the file and at the end of each line binarynumber to become: 111,5.67,2,4,566666,666667,111000,111000 111,5.67,2,4,566666,666667,111000,111000 111,5.67,2,4,566666,666667,111000,111000 111,5.67,2,4,566666,666667,111000,111000

Member Avatar for Ancient Dragon
0
97
Member Avatar for srinivasan106

wat is the concept beyond COLUMN SORT??.. can any body guide me...Y column sort is introduced??

Member Avatar for Ancient Dragon
0
80
Member Avatar for Ajith007

Dear friends.. i have been assigned the project of designing source code for Booth's multiplication algorithm in C. We have reached 60% of success but are now stuck.. if anyone has the source code in C or may be in C++ or even in microprocessor 8086 pls send it here …

Member Avatar for Adak
0
295
Member Avatar for TheBaby7591

This is the code I have so far. I can't even get the numbers range to print to the screen correctly. I am very new to all this stuff so go eacy on me. Can anyone help?? [code=c] #include <stdio.h> #include <stdlib.h> #include <math.h> #include <time.h> int main() { unsigned …

Member Avatar for TheBaby7591
0
111
Member Avatar for Caeon

I am currently writing a simple program that will either allow me to add music or show all of my albums, artists, and songs. The program starts in main(); then after selecting "View Music" it goes to the viewMusic() function but runs through the function and skips the getchar() for …

Member Avatar for Adak
0
89
Member Avatar for bosdak

#include<stdio.h> #include<conio.h> main() { int num, dep, with, bal; clrscr(); num=1; printf("MENU"); printf("\n\n1. Deposit\n2. Withdraw\n3. Check Balance"); printf("\n\nEnter a number of choice: "); scanf("%d", &num); switch(num) { case 1: printf("\n\n\nEnter an amount to be deposited: "); scanf("%d", &dep); { printf("You have successfully deposited an amount of %d.", dep); } getch(); …

Member Avatar for justiceigwe
0
2K
Member Avatar for phil750

Hey all, I've been trying to build a simple c shell for assignment, and im a bit stuck. It doing something different on my laptop to that it does on my pc :S laptop is on mint 7 pc is virtual machine on mint 8. Im using the getcwd to …

Member Avatar for C++ThugLife
0
277

The End.