15,552 Topics
| |
guyss i just want to ask if anyone could show me a sample program on how to count the number of words,letters,and sentences in a file....using the c language.... thanks in advance!! | |
I am changing the phase of signal from 0 to 360 by each degree to get max voltage value.Because if i change phase of the signal the voltage also changes.I have the fallowing code to find max value. and corresponding phase void Maxphase(float *max, unsigned int *index) { *max = … | |
#include <stdio.h> #include "genlib.h" #include "simpio.h" #include "string.h" #include "ctype.h" typedef struct { char name[30]; int apousies; }telikaT; void ypologismoi(FILE *inArxeio,telikaT students,int *p100,int *pAll); void emfaniseis(FILE *outArxeio,telikaT students,int *p100,int *pAll); main() { FILE *inArxeio,*outArxeio; telikaT students[30]; int p100,pAll; ypologismoi(inArxeio,students,&p100,&pAll); emfaniseis(outArxeio,students,&p100,&pAll); system("pause"); } void ypologismoi(FILE *inArxeio,telikaT students,int *p100,int *pAll) { char … | |
I created an article previously doing this program in C++, but now I am trying to convert it to C. #include<stdio.h> double hamCalc(double b, double p); double cheeseCalc(double b, double p, double c); double dcheeseCalc(double b, double p, double c); int main() { double patty, bun, cheese; printf("This is the … | |
#include <stdio.h> #include <string.h> struct mycar { char plate[10]; int ey,em,ed,eh,emin,qy,qm,qd,qh,qmin,wd,parked; }; struct mycar car[2]; int n; void main() { void input(); void display(); int menu(); void exit(); int op; n=0; printf(">>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<\n\n"); printf(">>>>\tCAR PARK SYSTEM MANAGEMENT SYSTEM \t<<<<"); printf("\n\n>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<\n\n"); for(;;) { op=menu(); //printf("op=%d"); if(op==0)break; switch(op) { case 1: input();break; case … | |
I want find size of array by pointer in a function.example : //char array[] is a random array,i can alloc dynamic,so i can know size,i want access a random possition in array. char* pointer; void myfunc (char * array) { pointer = array; //how many elements in the array??? } … | |
I am working on a program in Pro*C that uses fscanf to read a CSV file. This is a naive CSV file, with no commas allowed in the strings, and it is packed, with no whitespace between the fields. I read in a header record, which has some important information, … | |
A program that will create scrambled words by circularly rotating the middle characters of each word by 1 character. Place the scrambled words, 1 per line in an output file. Example: hamster becomes hmstear Sample input file: 4 dog pepper marker teapot Sample output file: dog pppeer mrkear tapoet | |
actually, i have given a task of a fb development. woek is that when ever any one allow the app, then that app will scan the posts and likes of that person. and that app will have database which will check that words (in posts and likes) with its database … | |
I am currently working on my assignment about a simple text editor that can open, add line and delete line and so and so... I designed an algorithm to add new line to the doc and it works for the first time but didnt work after it, I dont know … | |
Circuit, [Circuit Diagram](https://picasaweb.google.com/116591322380497799116/December52012#) Video: [Video](http://www.youtube.com/watch?v=qGoM_ydAtBc) | |
Hello I am just testing how to get the fatorial of a number by using MACRO - Here is my wrong code - #include <stdio.h> #include <conio.h> #define FAC(n) for(typeof(n) i=2; i<=n; i++){f *= i} void main() { int i=5; int j=FAC(i); printf("%d",j); getch(); } And these are error Error … | |
Hi, i have this piece of code, the encoding function creates a file of binary 1's and 0's but since i am getting output in a text file, the result is shown as ASCII characters which appear as garbage. can anyone please tell me what should i add in the … | |
so I haven't used pointers to this extent for a few years so I'm a little rusty. I'll give a quick explanation on what the code is supposed to do, but from looking at my output I am messing up pointer arithmetic somewhere along the lines. I'm pretty sure it's … | |
I am not able to see the desired output. Please let me know where I am missing a point. #include<stdio.h> struct node{ int data; struct node *next; }; void push_node(struct node *node, int data){ struct node *new_node = (struct node *)malloc(sizeof(struct node)); if(node!=NULL){ new_node->data = data; new_node->next = node; node … | |
i want solution of a c prog using functions ie to find lcm and gcd using functions in same program but to find lcm we will be using formula lcm=(a*b)/gcd; please help me out this is my code if modifiction are to be done then please send me modified code … | |
Hi everyone. I have written an MS-DOS based screensaver program by hooking timer and keyboard interrupt. After 10 seconds the screen is cleared and on clicking any button from the keyboard the contents of dos screen are shown. I want to know how can I make this screen to blink … | |
actually, I just want the idea here. I have a server, a client . client will request to display the files names in its directory(server's current directory). server will send the list. my thinking : system command will be used here. when clinet enter "-ls" then server will have system() … | |
I want to assign an array to a pointer variable. The way I am doing it is like this: int array[] ={1,2,3}; int **p_array = &array; (*p_array)[1] = 99; But when I run the program, it fails. Could anyone help me with the issue? Thanks in advance! | |
I have made a code and when I compile it I recieve the error saying "/tmp/cc9UNQMJ.o:in function bulbasaur: pokemon.c(.text+0x1074):undefined refrence to print collect2:ld returned 1 exit status" anyone have any idea what this could mean? (i will place full code after work) | |
how do you manually convert a multi digit ascii string into the hex equilavent of a decimal integer with out using a C library function. For instance If I have a small program asking a user to type into the keyboard a decimal number and lets say they type in … | |
ok, im working on an assignment implementing a circular queue (fixed size 15), shared memory, normal producer consumer problem, using three semaphores (one for the queue and one for each process). The objective is to have the producer put the characters from mytest.dat (max 150 chars) into a circular queue, … | |
Can anyone give a simple code to explain the statement"a funtion ca have multiple declaration but only one definition"? | |
Why is it compulsory and necessary to initialize static variables during compile time only? | |
Hello I am try to learn Brasenham Line Drawing Algorithm. I wrote this program in Turbo C # include <stdio.h> # include <conio.h> # include <graphics.h> void main() { int dx,dy,x,y,p,x1,y1,x2,y2; int gd,gm,errorcode; clrscr(); printf("\n\n\tEnter the co-ordinates of first point : "); scanf("%d %d",&x1,&y1); printf("\n\n\tEnter the co-ordinates of second point … | |
i was searching for a code to perform binary XOR addition. Exams coming up, and needed to a quick way to create and verify standard array tables. However, i didnt find anything substantial on the internet, so made my own version of it. can anyone take a look and tell … | |
I'm writing a C library to export SDL_Surfaces to various image formats as an exercise. Now I'm working on the GIF format and I feel I'm very close to getting it working, but I've been at this for a while with no luck. I've already re-read all the specs, wiki … | |
I've been trying to write this program and so far this is the best I could come up with. It doesn't work though. #include<stdio.h> #include<conio.h> void main() { FILE *fp,*fp1; int i=0; char str[80],fname[]="a1.txt",fname1[]="a2.txt"; clrscr(); fp=fopen(fname,"r"); fp1=fopen(fname1,"w"); if(fp==NULL) { printf("\n Cannot Open File : %s",fname); getch(); exit(1); } printf("\n File … | |
| |
Wondering if anyone has used SQLite. I'm having trouble with the basics. sqlite3_get_table function. The Apress book 'The Definitive Guide to SQLite' provides the following example. The first problem is that when declaring char *result[]; Things start to go wrong. I get an error message saying that *'the size of … |
The End.