15,551 Topics

Member Avatar for
Member Avatar for neclark2

For a school project I am doing we are required to take character input through the command line and convert the character to its ascii value. I would think, therefore, that the line of code: printf("%d",(int)argv[1]); would print out 97(ascii for a) if i were to type 'a' as the …

Member Avatar for Aia
0
74
Member Avatar for kedi

Hello, I need to write a program which displays some images on the screen depending on some calculations. For example if the result of the calculation is 3 it will display an image file, if it is 5 it will display another image file. I don't even know where to …

Member Avatar for Nick Evan
0
253
Member Avatar for missileh

Hi... Does anyone know how can we get motherboard details using a c program for a Mac machine ? I want details like Motherboard Manufacturer, Its Model No., Its version and Serial Number. How can this information be obtained ??

Member Avatar for missileh
0
90
Member Avatar for pitbro

Could you please help me? what is wrong with this code? it prints only D->D->D->D (I want A->B->C->D) [code=c++] #include <stdio.h> #include <stdlib.h> #include <string.h> #include <malloc.h> struct node /* Declaration of structure "node" */ { char letter[1]; struct node *next ; }; struct node *start = NULL; main(void) { …

Member Avatar for Ancient Dragon
0
152
Member Avatar for jaggesh

The question goes like this: You are given a file in which each line contains a list of space separated words. Write a program to find out: 1. List of words that are present in all the lines (words common to all lines) 2. List of unique words that are …

Member Avatar for Aia
0
101
Member Avatar for hallinan

write a bit of code to read from a file and compare a string but it dies before it finishes. the complier tells me there is a segment fault on line 31 can anyone help. [CODE] [LIST=1] [*]#include <stdio.h> [*]#include <string.h> [*]#include <stdlib.h> [*]#define max 100 [*]struct customer{ [*] [*] …

Member Avatar for Aia
0
158
Member Avatar for RexxX

I want to store a byte from fread as type char, and then be able to perform comparison operations on that byte as an int. I have [quote] int num; char buffer; num = fread(buffer, 1, 1, myFP); [/quote] and I'm sure it's not right.

Member Avatar for John A
0
113
Member Avatar for newport

I'm trying to make a program that converts octal numbers to decimal numbers. I know the concept is taking the %10 of the number to get the first digit, /10 the number then take the %10 to get the second digit and multiplying by increase powers of 8, but I …

Member Avatar for Narue
0
171
Member Avatar for wolverine_ramir

i need a sample program for handling text files using c language.. i don't know the syntaxes.. please help me and provide some comments on the source code so that i'll be on track.. Things that i need: 1) How to locate the text file 2) How to input values …

Member Avatar for John A
0
149
Member Avatar for wollacott

my program stops right before the while loop [CODE] #include <stdio.h> int main() { int pay_type_1; int overtime; int num; float commissionsale; float payperitem; float salary; float hourrate; const float commissionrate=0.057; const float commissionpay=250; const float overtimerate=1.5; printf("paytype1=Managers salary\n"); printf("paytype2=hourly worker\n"); printf("paytype3=commision worker\n"); printf("paytype4=piece worker\n"); while (pay_type_1 > 0) { …

Member Avatar for ithelp
0
105
Member Avatar for RexxX

I'm better at C++ than C right now and I forgot how to use arrays in functions from main. I want to do something like [quote]void fileReader(infile[] ); [/quote]. Is infile supposed to be a pointer and if so how is it written?

Member Avatar for Aia
0
75
Member Avatar for monto

hi everybody there......i want to access the addresses other than provided to me c compiler......can anybody help

Member Avatar for Narue
0
97
Member Avatar for hallinan

hi I'm doing a banking project using binary files I need to write into a binary file and read and calculate the amounts within it. I open a file by asking the user for their name and searching and a file. I am having trouble reading the integers into a …

Member Avatar for zhelih
0
139
Member Avatar for manimaran_c

Need to work on an assignment in C for the following. 1. Changing the size of the cursor 2. Placing the cursor at an appropriate position on screen. 3. Drawing any graphics shape on the screen 4. Receiving a key from the keyboard 5. Checking the memory size of the …

Member Avatar for Narue
0
88
Member Avatar for fskhan

Hello, Hi I Need To Flip The Bits In An Integer (not Toggle Them But To Actually Get A Mirror Image With Respect To Bit Positions). The Problem Is That I Am Taking An Input Data In Integer Form From A System But It Places The Msb At 0th Position …

Member Avatar for jephthah
0
3K
Member Avatar for wollacott

A company pays its employees as managers (who recieve a fixed weekly salary), hourly workers (who recieve a fixed hourly wage for up to the first 40 hours they work and "time- and a half"-1.5 times their hourly wage-for overtime hours worked), commission workes (who recieve $250 plus 5.7% of …

Member Avatar for jephthah
0
129
Member Avatar for newport

I'm trying to make a program that asks the user what he/she wants to do, but when invalid inputs are entered, the program does not tell the user right away. Also, the sentinel value does not work. Thanks. [code] #include <stdio.h> int main () { int selection; float sum, difference, …

Member Avatar for rhish.franks
0
195
Member Avatar for Tommms

Hello everyone! I have a specific C question that I have not been able to solve. How do you count the number of particular numbers inside an integer variable? For example: int variable; The user inputs 22222 into the variable. The program displays "You entered five twos". How do you …

Member Avatar for rhish.franks
0
213
Member Avatar for loimarie

Hi to all viewers and members! can anybody help me or gave me any idea about parallel port interfacing that accepts input from a switch instead of keyboard and that input will be displayed in a seven segment.just a sample c program that has an input(inport) and ouput(outport) through the …

Member Avatar for Colin Mac
0
328
Member Avatar for haroonob

hi I have to made a program which read all blocks of hard disk and after reading give me hard disk capacity and its bad block i C language. Kindly tell me how can i read hard disk blocks and how i can know this block is bad or ok …

Member Avatar for Ancient Dragon
0
97
Member Avatar for dinosaurclover

Can one of you geniuses out there help me please. They say that compiling and running hello world is the hardest bit. They're right. I've got debian on my laptop. I read a so-called tutorial that reccomended gcc hw.c OK. So I get a file called a.out. Allegedly an executable. …

Member Avatar for plgriffith
0
138
Member Avatar for wollacott

can anyone help me finish my program please. thank you [code=c] #include <stdio.h> #include <math.h> int main() { int product; float product1 = 2.98; float product2 = 4.50; float product3 = 9.98; float product4 = 4.49; float product5 = 6.87; float quantity = 1; double unitprice; float result; double total; …

Member Avatar for Aia
0
112
Member Avatar for peteefb

[code=c] //* By peter blatcher *// #include <stdlib.h>; #include <stdio.h>; #include <math.h>; float trap(float b, float Xo, int n); float integ(float X); int main() { float Va, Ve, difference, n, area, Fao, kCao, y, X, a, b; char c = n; n = 2; Fao = 0.4; a = 0.8; …

Member Avatar for Ancient Dragon
0
146
Member Avatar for jbd

Hi I'm adapting some code I've written using 2d arrays (to represent matrices) to handle large arrays such that double matrix[][] goes to double **matrix and then I'm using malloc. It seems to work fine for part of my program up to where I have to find the matrix transpose …

Member Avatar for Duoas
0
190
Member Avatar for mayank24
Member Avatar for mayank24
Member Avatar for mayank24
Member Avatar for mjoshi

Hi, I have written a program that copies one file to another while making format changes to some lines The relevant part of the code is the following" [code] while(fgets (cbuff, 80, f1)!= NULL) { if ( (isdigit(cbuff[5])) && (isdigit(cbuff[11])) && (isdigit(cbuff[17])) ) { strncpy (c1, cbuff+1, 5); c1[5] = …

Member Avatar for Ancient Dragon
0
97
Member Avatar for vinaygarg

[CODE] Struct threshold { long value; int exponent; }t1,t2; t1.value = 2; t1.exponent =3; t2.value = 3; t2.exponent =4; [/CODE] The first structure (t1) is 2 x 10^3 The second structure (t2) is 3 x 10^4 I want to get the result after division of the two structures. The Reault …

Member Avatar for vinaygarg
0
90
Member Avatar for mmcshmi11

I need to print out a number that begins with 7, without the seven. For example, print 71011 as 1011 or 701 as 01. I've tried many techniques and just can't get it to work. Is there a printf format that will let me print out everything left of the …

Member Avatar for invisal
0
111

The End.