15,552 Topics

Member Avatar for
Member Avatar for syria718

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!!

Member Avatar for bhavya_best
0
3K
Member Avatar for vebi1000

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

Member Avatar for vebi1000
0
196
Member Avatar for anestistsoukalis

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

Member Avatar for anestistsoukalis
0
982
Member Avatar for danthegreat

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 …

Member Avatar for danthegreat
0
209
Member Avatar for gAdIs90

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

0
73
Member Avatar for dangkhoaddt

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

Member Avatar for dangkhoaddt
0
201
Member Avatar for JohnMcPherson

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

Member Avatar for deceptikon
0
948
Member Avatar for kwm123

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

Member Avatar for deceptikon
0
114
Member Avatar for nitin1

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 …

Member Avatar for nitin1
0
98
Member Avatar for poisonousgu

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 …

Member Avatar for Ancient Dragon
0
281
Member Avatar for NicAx64

Circuit, [Circuit Diagram](https://picasaweb.google.com/116591322380497799116/December52012#) Video: [Video](http://www.youtube.com/watch?v=qGoM_ydAtBc)

0
486
Member Avatar for vishalonne

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 …

Member Avatar for Tumlee
0
136
Member Avatar for amnakhan786

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 …

Member Avatar for Ancient Dragon
0
98
Member Avatar for Dewey1040

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 …

Member Avatar for Dewey1040
0
118
Member Avatar for umesh314

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 …

Member Avatar for umesh314
0
108
Member Avatar for pooja.singh.3950

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 …

Member Avatar for Gonbe
-2
168
Member Avatar for mohsinjaved11

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 …

Member Avatar for tinstaafl
0
281
Member Avatar for nitin1

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

Member Avatar for L7Sqr
0
157
Member Avatar for hg_fs2002

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!

Member Avatar for Ancient Dragon
0
98
Member Avatar for totalwar235

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)

Member Avatar for totalwar235
0
90
Member Avatar for jetro57070

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 …

Member Avatar for jetro57070
0
7K
Member Avatar for marc.punzirudu

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

Member Avatar for marc.punzirudu
0
2K
Member Avatar for saurabh.mehta.33234

Can anyone give a simple code to explain the statement"a funtion ca have multiple declaration but only one definition"?

Member Avatar for marc.punzirudu
0
157
Member Avatar for saurabh.mehta.33234

Why is it compulsory and necessary to initialize static variables during compile time only?

Member Avatar for marc.punzirudu
0
198
Member Avatar for vishalonne

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 …

Member Avatar for Ancient Dragon
0
129
Member Avatar for somjit{}

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 …

0
172
Member Avatar for NordCoder

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 …

Member Avatar for NordCoder
0
232
Member Avatar for billionair

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 …

Member Avatar for deceptikon
0
1K
Member Avatar for christopher.magalso
Member Avatar for daino

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 …

Member Avatar for Ancient Dragon
0
1K

The End.