15,552 Topics

Member Avatar for
Member Avatar for Clockowl

Is it possible to read a whole file at once with text files, or can I only use fgets and is that the most data I can fetch at any time? (fread() doesn't work on text files, I've experienced and then been told ;-)). Thanks in advance, PS: And suppose …

Member Avatar for WaltP
0
447
Member Avatar for rrreeefff

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 …

Member Avatar for rrreeefff
0
152
Member Avatar for Hacker_517

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 …

Member Avatar for Clockowl
0
106
Member Avatar for skankest

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 …

Member Avatar for skankest
0
137
Member Avatar for Clockowl

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) ; …

Member Avatar for Clockowl
0
105
Member Avatar for aoi

[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 …

Member Avatar for ahamed101
0
105
Member Avatar for amith_hrd

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.

Member Avatar for Salem
0
94
Member Avatar for psyman_86

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, …

Member Avatar for Salem
0
153
Member Avatar for vladdy19

Is &(&z) ever legal in C? please give an example, i'm having a hard time understanding this.

Member Avatar for ArkM
0
64
Member Avatar for rrreeefff

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; } …

Member Avatar for ahamed101
0
158
Member Avatar for TooMpa

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 …

Member Avatar for ssharish2005
0
162
Member Avatar for omdnaik

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 …

Member Avatar for ssharish2005
0
142
Member Avatar for asifjavaid

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 …

Member Avatar for ssharish2005
0
1K
Member Avatar for omdnaik

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 …

Member Avatar for ssharish2005
0
160
Member Avatar for rrreeefff

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= …

Member Avatar for rrreeefff
0
97
Member Avatar for Strat79

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 …

Member Avatar for ahamed101
0
235
Member Avatar for ambarisha.kn

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. …

Member Avatar for ambarisha.kn
0
132
Member Avatar for califguy

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, …

Member Avatar for rpiper138
0
109
Member Avatar for ashkash

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 …

Member Avatar for rpiper138
0
2K
Member Avatar for makubexiii

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 …

Member Avatar for makubexiii
0
136
Member Avatar for botter911

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 …

Member Avatar for twomers
0
180
Member Avatar for programmergirl

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. …

Member Avatar for Sci@phy
0
248
Member Avatar for Avaleriona

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, …

Member Avatar for Ancient Dragon
-1
139
Member Avatar for botter911

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] …

Member Avatar for botter911
0
112
Member Avatar for JONZ

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 …

Member Avatar for Ancient Dragon
0
109
Member Avatar for mauro21pl

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 …

Member Avatar for stilllearning
0
85
Member Avatar for deepugtm

I want to use getimage function to store the image in memory but cant ,please help me

Member Avatar for Narue
0
67
Member Avatar for deepugtm

I want to write some programs and even games using graphics of C.Please Help me to write these.

Member Avatar for Narue
0
157
Member Avatar for ahamed101

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 …

Member Avatar for ahamed101
0
488
Member Avatar for xcyrus_tan_rx

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 …

Member Avatar for xcyrus_tan_rx
0
145

The End.