15,552 Topics
| |
This program was written and tested in unix/linux environment (in EMacs editor )with a GCC compiler. | |
I am trying to take a user's input and assign it to a certain part of a structure. This code is in my book so I assume it's correct: [code] scanf("%d", &part_number); inventory[num_parts].number = part_number; [/code] I need to do the same thing but with a string instead of a … | |
hi, this is the code for switch:[CODE] include <stdio.h> main() { int i=2; switch(i) { case 1; printf("i am in case 1\n"); break; case 2; printf("i am in case 2\n"); break; case 3; printf("i am in case 3\n"); break; default; printf("i am in default\n"); } }[/CODE] and this is the … | |
Dear colleagues I am currently working on designing a scheduler using Borland C. I am struck with the concept of interrupts. I am trying clock tick interrupt for task switching. In all materials they say you will continue to your regular job until the interrupt occurs. I don't think it … | |
Hey, I have a program that it supposed to read two columns of data and then perform a calculation on them. The problem is reading the data in from the file. I have a function to count the lines, this works correctly. It returns it's value into a variable called … | |
In the following c code, the num_elements is gobal. But if i make it as local and return , it gives strange value just before return it becomes '0' ...can anybody explain why ? [code] int num_elements =0; //generates a psuedo-random integer between min and max int randint(int min, int … | |
I've got a large array of coordinates (a struct containing x and y, among other things) and for each pair of coordinates, I'm trying to find another pair that's closest to it from that array. [code] int i, j, d = 0, cd = 0, closest; for(i=0;i<size;i++){ closest = 0; … | |
Hello I need help to write a c program that prints a laon amortization schedule when user imputs, principal, annual percentage rate of interest, number of years to pay off the loan and monthly payment. original loan amount=10,000 number of payments is 36 APR is 7.50 payment is 311.06 monthly … | |
[CODE=C] /* This program returns a run time error as follows: "Your code has stopped its execution with a non-zero (failure) exit value.This is generally due to run time Exceptions like Memory Access Violation and Floating Point Exception. Please check your code for run time Exceptions and try again." PLEASE … | |
Time limit : 10 secs. (The program must produce output for all test cases within the stipulated time) A spaceship carrying a convention of high ranking officials had a close shave with a meteor. They are now scattered over the surface over a meteor and the spaceship is beyond repair. … | |
im using borland [CODE]/*Write a function that will scan/read each line of a given text file and determine whether a line is valid or invalid. A line is said to be valid if and only if it satisfies the ff: a. the line is composed only of characters a and … | |
Hi , I read that c is not a block structured language. means it does not allow defining functions inside other functions. but this code is not generating any error not even warnings, though we nest the functions. whats the story. [CODE] #include<stdio.h> int main() { int num; num = … | |
Hi i have written a program to check the precision of float and double values. i read that the precision of float is 6 digits and double is 10. but it is showing only 6 for both. do we need to make any arrangement for the system to print the … | |
Hello guys, I've got a question related to my data structures class. I have file in which data is unordered. Say: hello apple blue phone number I have to search a string using Binary Search. But since we cannot apply Binary Search to unordered list, we should make an ordered … | |
Dear all, I practice a program about "stack by linked list" and I found this error [COLOR="Red"]"suspicious pointer conversion"[/COLOR] in the part of defining "push" and "pull" function. Thank you in advance. Ahmed Helmy ITI student. | |
Hey, I am currently following a code skeleton to implement the missing code for some function. Below is only some part of the implementation I've done so far. Yes it is not much yet... I got stuck for the implementation of the [B]list_add()[/B] function. What I want to do there … | |
Logic Used: Insert Pixel Data into a struct containing RGB values of the pixels read Data in a 3x3 array: | BGR(-1,-1) | BGR(-1,0) | BGR(-1,1) | | BGR(0,-1) | BGR(0,0) | BGR(0,1) | | BGR(1,-1) | BGR(1,0) | BGR(1,1) | Assign Average of all Blue,Green,Red components respectively to another … | |
I am a new person to c programming but i know some of its fundamentals if someone could help me out in this program it would be of great help. The program is to read a positive integer number n, and perform the squares of individual digits. For example n=205 … | |
I am stuck in this program for the last 5 days please help me out.The output which I had got is entirely different from the desired output.Please its urgent The program is to read a positive integer number n, and generate the numbers in the following way. (eg: if the … | |
Sorry, solved my own problem. [CODE] #include <time.h> time_t current = time(NULL); char date[11]; strftime (date, 11, "%m/%d/%Y", localtime (¤t)); [/CODE] | |
can we type while ( "variable" = '\n') ? or an error will occur? | |
I need help in Graphic programming in C. I donno how to start. I use Visual C++ compiler which doesn't support <graphics.h> Please somebody help. I can't find anything!:sad: | |
Hello all, I'm working on a school project (in C) that I'm having some issues with. I have a number of threads which recursively send information between one another via sockets. The structure for the recursive case is as follows.. Loop For A Long Time { Receive From Predecessor Respond … | |
Hi i'm having some trouble getting my head around this assignment... which is : Design, write and test a program to print a table of factorials. The program should read in two values: a maximum factorial value and a minimum factorial value. It must then print a table, as illustrated … | |
Hello everyone, Here's my code for making a dynamic array(the user inputs the size of the array). It's working fine but I think that I've not made the best code. Is there any suggestion for improvement or optimization? [code] #include <stdio.h> #include <stdlib.h> int main(void) { int *p; int n,i; … | |
Hey everyone, I am stuck on the last function of my problem, could someone help me get started by helping me on the first part of function? Question: I need to write a random function to get 2 numbers from 1-6, and needs to be in a loop 25 times … | |
Hey guys, i am writing a couple of programs but I have some problem with the basic one... can you please provide me with a 24 hour clock which has hour, minute and second? also it should have the ability to set the time.. your help is highly appreciated...it is … | |
hi , i have read that c99 introduced: inline,_Bool,restrict,_Complex,_Imaginary i have used _Bool here but do no how to use remaining all please any one used the above can help me. [CODE] int main() { _Bool b; b=true;// giving error true undeclared ,cant i use that way // with out … | |
Hello people :) My teacher gave me a new project to work on. I need to write an application that output all the letters of the alphabet in a random order. I've made some applications before but im still kinda new to this. Could any of you give me a … | |
Hi All, I am facing a problem with using the function [B]strtok()[/B]. Following is just a sample code. The code below stores the string [B]str[/B] delimited by comma into an array. I want to modify the code below so that array would contain an empty space/new line if a value … |
The End.