15,551 Topics
| |
Hi there again i tried answering the question amm i hope you guys can understand it its a structure ahh i am to: Write a program using (structures) that stores the details of students in a school. Create a structure called students with the following structure elements: Student name. student … | |
Say I have [code] #include<iostream.h> int tempNum; struct node { int data; struct node *next; }; struct node *newNode = NULL; int main(void) { tempNum = 5; newNode->data = tempNum; //gives seg fault } [/code] *edit - I'm trying to add tempNum to the very first node. I haven't worked … | |
ok i need to do a program that inputs a amount of characters. my program has to capitalize the first letter and and letter after a full stop. any ideas and hints how to do it? | |
What enables C to support variable number of function arguments (varargs), while other languages (like Java) do not support this feature? What is special in C which is not there in Java to support this? | |
[CODE] #include<stdio.h> main() { static int n=0, number=1; int fibi (int n, int number); printf ("Following are the first 40 Numbers of the Fibonacci Series:\n"); printf ("1 "); fib (n,number); } fib (int n, int number) { static int i=1; int fibo; if (i==40) { printf ("\ndone"); } else { … | |
Hello all. Sorry to be a bother but I cannot figure out what is wrong with my homework program that's due before midnight. The assignment is to create a program with a two-dimensional array that generates a random walking path. I'll list the assignment as it is probably clearer. [I]Write … | |
Hi all, I am wondering if anybody has any good links for displaying floats. I have been working with some pre-written code that has bugs in, at the company i work for. But i keep having problems with rounding. I am considering re-writing it but what to get to grips … | |
Need help I wont to get a system date as integers such as(22/02/2008) rather than string cause I need this to compare two dates any ideas? | |
I am a beginner and need help with my program in C. My assignment is to find all the prime number up to the number the user input using a sieve algorithm. for example if user input 6 , the prime numbers will be 2, 3, 5. Then it should … | |
ok this is my code so far i have to use " isprime" to calculate prime number how do i do thatand where do i put it.thank you [CODE] #include<stdio.h> main() { static int n=0, number=1; // static: so value is not lost int fibi (int n, int number); printf … | |
Keep getting an error 'syntax before struct_acc' but cant see where can YOU?! (it's like finding woldo to me) [CODE] void print_customer_statement(char customer[]) { int choice; struct_acc Acc[SIZE]; FILE *file_ptr; int i=0; file_ptr = fopen(customer, "rb"); if (file_ptr == NULL) { printf("Error in Opening files... Program End\n"); exit(1); } while(!feof(file_ptr)) … | |
can anyone help me? Write functions to: int isprime(int); /* Returns a true value if a is a prime number */ int nextFib(); /* Returns the next fibonacci value (use static variables to track which one was used last call) */ The fibonacci sequence is defined as: Fib(0)=1 Fib(1)=1 Fib(2)=Fib(1)+Fib(0) … | |
I Am Working On A Project Related To Data Compression Using Huffmann Algorithm In C Language..........i Have Generated The Huffmann Codes Using Huffmann Tree.........but The Project Is Yet To Be Completed As I Don`t Know How To Store The Codes In Bits.............i Have Just Learned C. We Have To Submit … | |
Suppose I have a function like that [CODE]char OnRelease() { int i,j,k; int row[4]={PIN_A0,PIN_A1,PIN_A2,PIN_A3}; int col[4]={PIN_D3,PIN_D2,PIN_D1,PIN_D0}; char array[16]={'1','4','7','<','2','5','8','0','3','6','9','>','C','&','E','M'}; set_tris_a(0xff); set_tris_d(0x00); k=0; for(i=0;i<4;i++) { output_d(0xff); output_low(col[i]); for(j=0;j<4;j++) { if(input(row[j])==0) { do { } while(input(row[j])==0); return array[k]; [B][COLOR="Red"]//// will jump out of this function with the value I got ??? [/COLOR][/B] } … | |
Back to where I was, now I'm learning how to use fgetc properly. Does fgetc read in a character? If so I can't find my error in my code and I'm getting a a segfault. Can you help fix it and explain why it doesn't work? Thanks [code]#include<stdio.h> //declare variables … | |
I have a program which uses the SDL library. Here is my function which updates the input state: [code] int SDL_UpdateControls () { int qevent = 0; while(SDL_PollEvent(&event)) { qevent = 1; switch(event.type) { case SDL_KEYDOWN: SDL_keydown = event.key.keysym.sym; break; case SDL_KEYUP: SDL_keyup = event.key.keysym.sym; break; case SDL_MOUSEBUTTONDOWN: SDL_mousedown = … | |
OK, i found this site because I did a yahoo search to calculate the parking charges and print the total, Well someone else had it already posted but once I registered I lost it. I am not even supposed to be in this class but I have to take it … | |
my teacher gave me an assignment to complete the blackjack program but I have little understanding of it. I have the majority of it but i'm missing pieces. [B]NOTE: All of the sections where it says TO DO are the missing pieces.[/B] PLEASE HELP. [code=c] #include <stdio.h> #include <stdlib.h> #include … | |
I need help on how to properly combine two programs into a single program. This is the first program: [code] int main() { FILE *input, *output; char doc; input = fopen("input3.txt","r"); output = fopen("output.txt","w"); while(!feof(input)) { doc=fgetc(input); if(doc==EOF) break; else { if(doc==';') { while(!feof(input)) { doc=fgetc(input); if(doc=='\n') goto out; } … | |
hi,I have a problem here. [CODE=cpp]#include "stdafx.h" int main() { int speed, dist, time, force, mass, masss, accel, velo, moment; int choice, choose; char pilih, pick; do{ printf("\t\t\tWelcome to Physics (Force and Motion)\n"); printf("\t\t***************************************************\n"); printf("\t\t\tCHOOSE SECTION\n\n"); printf("\t1. FORCE\n"); printf("\t2. SPEED\n"); printf("\t3. MOMENTUM\n"); printf("\t4. END\n\n"); printf("Choice: "); scanf("%d", &choice); switch(choice){ case … | |
Could someone help me please? I can’t get it to work, and it wouldn’t show me salary in two significant digits for example Enter # of hours worked (-1 to end): [B][COLOR="Red"]41[/COLOR][/B] Enter hourly rate of the worker ($00.00): [COLOR="red"][B]10.00[/B][/COLOR] Salary is [COLOR="red"][B]$415.00[/B][/COLOR] Enter # of hours worked (-1 to … | |
I have a text file which has the following format..... 129.2.3.87 18.3.6.77 5655 2333 here the first field is source ip address then destination ip address then source port and destination port there are many such entries..... i want to know how do i extract these fields using c program … | |
I am looking for a front end/graphical user interface(GUI) in linux which supports C language as backend. | |
Develop a program that will determine the gross pay for each of several employees. The company pays “straight time” for the first 40 hours worked by each employee and pays “time-and-a-half” for all hours worked in excess of 40 hours. You are given a list of the employees of the … | |
I'm getting a segmentation fault when I try to run my program. It's probably because I'm not referencing my pointer to a string right, or dereferencing whatever it's called. This is basically what my code looks like. [code] #include <stdio.h> FILE *myFP; char filename[20]; char *pstr = finlename; void func(char … | |
I am writing a calculator program in C. I need a function definition for a function called Subtract() that will allow me to calculate the difference of several numbers entered by the user also need one for division | |
what is meant by generic linked list. how to insert and delete the elements in the linked list which is generic | |
//I tried to fix the errors but I failed. //pls do it for me....... [code=c] #include<stdio.h> #include<conio.h> void main() { int a; void scanchar(char**); int scans(char**,char*,int,int); int scani(char**,int,int,int,int,int,int); int myscanf(char *); int smyscanf(char*,char*); clrscr(); printf("enter"); myscanf("%d",&a); printf("%d",a); getch(); } static void scanchar(char **str) { extern int getchar(); if (str) { … | |
I am using an open source library called IGI_UDP for measure the available bandwidth of a link ([EMAIL="http://www.cs.cmu.edu/%7Ehnn/igi/"]http://www.cs.cmu.edu/%7Ehnn/igi/[/EMAIL]). with that library they have provided a "Makefile" which is not an auto generated one. the following is the given Makefile, ***************************************************************** CC = gcc INCS = -I. CFLAGS = -g -Wall … | |
I've never coded in c before but have to for a class that I'm taking. I'm using miracle c as my compiler but am having a strange error when I try to execute a program. The program executes, but the command window instantly closes so I can't even tell if … |
The End.