15,551 Topics
| |
I am trying to write a recursive function that compute a to the n. here is as far as I have gotten as far as code [code=c] #include "stdafx.h" #include "stdio.h" int power (int n); // function prototype// main() { float a; int n; printf("\n enter values of a an … | |
I have a problem with bulding a program to store a family record, this record consits of : name, birthday, married? and number of child. What is the best way to store this record??? Could you give me some example about some task on this structure : Input name and … | |
i'm trying to control four separate lighting arrays using a timer overflow interrupt to control four pulse width modulations. at the same time i want to be able to control the pwm frequencies using serial communication. i'm using a version of pic lite for my compiling and can compile my … | |
How would I reuse functions in C? I've tried simply sticking them in a [icode]#include <myfunctions.h>[/icode], but that didn't work... Any (complete) suggestions/links on how to do this? I googled some and found this: [code]The way to write a header file is: functions.h: int sum( int a, int b) ; … | |
[code] t=malloc(sizeof(NODE)); t->lname[i]=ln[i]; t->fname[i]=fn[i]; t->add[i]=ad[i]; t->telno[i]=tn[i]; t->next=NULL; i++; if(*h==NULL){ printf("\nCreating record..."); *h=t; } else{ p=*h; if(p->next!=NULL) { while(p->next!=NULL){ if(strcmp(p->lname[i],ln[i])>=0){ p->prev->next=t; t->next=p; } p->prev=p; } } else { if(strcmp(p->lname[i],ln[i])>=0) { p->next=t; t->prev=p; t->next=NULL; } else { p->prev=t; t->next=p; } *h=p; } } [/code] could help me with my code? i can't … | |
Hai, Will any body help me give the source code for accessing the serial port in turbo c. i need to communicate with GSM MODEM. and please explain me about the hand shaking signals. Here the hand shaking singnal should be Hardware. | |
Hi, I have a structure in a library that defines various parameters for wireless transmission. I want to create an array of these structures, which each element in the array containing the required parameters for a particular wireless channel. The structure: [CODE]typedef struct S_RF_RXTXPAIR_SETTINGS { byte modem0; // Baudrate, xosc_freq, … | |
Is &(&z) ever legal in C? please give an example, i'm having a hard time understanding this. | |
I created this function and I need help turning this into a recursive function [code=c] #include "stdafx.h" #include "stdio.h" int fact (int n); // function prototype// int main (void) { int n,result; printf("please enter a positive integer"); scanf("%d", &n); result = fact(n); printf("The answer is %d\n", result); return 0; } … | |
Hi like to write a program that can take arguments like %program -t <type> <path> <path> <name> where -t follow by type is the file type I like to look for in a find program, and path's is where I want to look, followed by the name of the file … | |
Hiii there... I have programmed a scientific calculator using C which performs every single task dat a hi tech calci can perform.. It stores all the calculation dat u performed on the day.... i am using a .txt file to store d calculations But the problem arises while retriving the … | |
hi guys, working in C using Borland Compiler we can get scan codes of keyboards keys by this code [code] ch = getch(); if (ch == 0) ch = getch(); printf("%d",ch); [/code] because when first time getch() is called, it will return the ascii code of the pressing key. when … | |
Hi frnds, i have been programming for abt a yr now n used to consider myself gud wid c programming until i chked out this forum.... Some of U guys are fantastic. So i wud appreciate if ne cud gimme topics on c programming dat will hlp me hone my … | |
Hello, I am trying to do a recursive function using fiboncci. I have been working on this and it is not working. #include "stdafx.h" #include "stdio.h" int fib (int n); // function prototype// int main (void) { int num, result; printf ("Please enter a positive integer\n"); scanf ("%d", &num); result= … | |
This program is a double-linked list in C for my System's Software class. Everything worked fine, until I coded the delete() and insert() functions. The program compiles and executes on a window machine using Dev C++. It also compiles without any errors or warnings on a linux machine using gcc … | |
Hi, I am allocating memory for some areas. For DB i need 1024 bytes, for DS 1024*2 bytes and so on, and i initialised address as follows. I initailise devBaseAddr to DB, because DB comes first, and next DC. DB is 1024 bytes , so for DC=DB+1024. This is DC address. … | |
Hey, What I am looking to is this: Receive 32 bytes of data from serial port into an array. ( This I have done already) Now based on say the second byte in the first 32 bytes, i will know the size of the entire packet I need to receive, … | |
I am trying to combine byte values into a long variable. I have four bytes each in an unsigned char: unsigned char a = BC; unsigned char b = 1E; unsigned char c = 04; unsigned char d = 00; I want to have it so I can put the … | |
can someone help me? Still confused in linked lists. there's something wrong when I input a record for the 2nd time. it sometimes works but then when I display all records It doesn't display correctly. here's the code... [CODE=c] #include<stdio.h> #include<conio.h> #include<stdlib.h> #include<string.h> typedef struct node *nd; struct node{ int … | |
I am trying to load the bmp image from my C to the console and it works. The image opens. But the problem now is the console hangs. Is there something wrong in my code? Or what should I change to avoid making the console hang. [CODE] #include <stdio.h> #include … | |
I'm to this whole modularity thing. We were asked to do our own libraries .h and .c files and to call them in main. The main objective of the program is to compare bubble and select sort. So far, I have all the libraries along with their respective .c files. … | |
Thanks [CODE]#include <stdio.h> #include <stdlib.h> struct Node{ int data; Node *link; }; typedef Node* NodePtr; void addToEnd(NodePtr* head, int val); void printList(NodePtr head); NodePtr mergeLists(NodePtr* list1, NodePtr* list2); int main() { int nextInt; NodePtr list1 = NULL; NodePtr list2 = NULL; printf( "Enter integers in sorted order for first list, … | |
I have made a function that detects F1 key at the end of the program and starts it again. But what I wanted was that even if user is in the middle of the program when the user presses F1 it immediately restarts the program. Here is my code: [code] … | |
Can anyone fix my code especially in the updateRecord function because instead of updating,data remains the same. [CODE]int newRecord( FILE *fPtr ) { /* create clientData with default information */ struct clientData client = { 0, "", "", 0.0 }; int accountNum; /* account number */ /* obtain number of … | |
Hi guys I have a small problem. It could be not enough information to obtain the right answer but I will try. So I have a problem regarding liked lists. It works perfectly fine when is compliled under Windows using Dev-C++ compileer. But when I try to complile under Unix … | |
I want to use getimage function to store the image in memory but cant ,please help me | |
I want to write some programs and even games using graphics of C.Please Help me to write these. | |
Hi everyone, Need a small help. I need to read the data from stdin (standard input) without hitting enter. Need to read the data as in and when they are typed in until EOF (CTRL + D as I am using UNIX) is encountered. I tried, getc() - requires ENTER … | |
pls help me with my code! it wont align! T_T i cant get it to work correctly! pls help guys! heres the screenshot! the date wont align huhu! [IMG]http://img72.imageshack.us/img72/4647/helprk3.jpg[/IMG] [code] #include<stdio.h> #include<string.h> #include<conio.h> int getNumberOfDays(int month,int year) { switch(month) { case 1 : return(31); case 2 : if(year%4==0) return(29); else … | |
I need help with program i cant find a way to get rid of the error and if i think a little bit more my head will explode this is a 2day program for me [CODE]#include <iostream> #include <stdio.h> #include "simpio.h" #include "strlib.h" #include "random.h" #include "string.h" using namespace std; … |
The End.