- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 2
- Posts with Downvotes
- 1
- Downvoting Members
- 2
5 Posted Topics
#include<stdio.h> void squeez(char s[],char z[]); int main() { char s[100] = "Hey wassup !!!!!!"; char z[100] = "Wow cool!!!!!"; squeez(s,z); return(0); } void squeez(char s[] , char z[]) { int j,dummy = 0,i=0; char x[100]; for(j = 0 ; s[j] != '\0';j++)/* the starting loop */ { while(z[i] != '\0') …
Here is the source code I came up with: #include <stdio.h> #define SPACE ' ' int main(void) { char c, prev; int space, newline; long other; space = 0; newline = 0; other = 0L; printf("Enter text to be analyzed (# to terminate):\n"); __fpurge(stdin); /* clears buffer */ while((c = …
#include <stdio.h> #include <conio.h> #include <stdlib.h> #define EOF -1 main () { FILE *data; char let; int prior, ctr; if((data = fopen("huffman_table.txt", "r+"))!='\0') { while (fscanf(data, "%c%d\n",&let, &prior)!=EOF) { printf("\nLetter: %c Priority: %d", let, prior); } } fclose(data); getche(); } The huffman_table.txt contains the content: B1 H1 J4 G5 F6 …
[CODE]/* file should be opened in append mode*/ int found=0; while(fgets(charin, BUFFER, fp) != NULL) { if(strcmp(charin, buffer) == 0) { printf("already exists\n"); found = 1; break; } } if(found == 0) { fscanf(fp,"%s",buffer); }[/CODE]
#include <stdio.h> void ReverseString(char *inStr, int length); void ReverseString(char *inStr, int length) { char temp; int j=length-1; int i=0; while( i < j) { temp = *(inStr+i); *(inStr+i) = *(inStr+j); *(inStr+j) = temp; i++; j--; } } int main() { char mike[] = "Hello"; ReverseString(mike, 5); printf("%s", mike); }
The End.
girishn