No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
I'm about to make code that read the text file line by line, then store it to stucture, then use quicksort. But my code doesn't print anything. Here is my code and text file. #include <stdio.h> #include <stdbool.h> #include <string.h> #include <stdlib.h> struct city{ char nation[2]; char region[10]; char name[50]; … |
|
My program find the amount of specific word such as "whale" and "thee", but ignore "thee,", "whale....", and so on. How can I contain them? #include<stdio.h> #include<string.h> #include<ctype.h> int main(){ FILE *md,*out; char CHA[255]; char cha[255]; cha[255]=tolower(CHA[255]); char thee[]="thee"; char chapter[]="chapter"; char whale[]="whale"; char meet[]="meet"; int th=0; int ch=0; int … |
|
I wrote the code that using txt file, but error "0 [main] assignment4 16012 cygwin_exception::open_stackdumpfile: Dumping stack trace to assignment4.exe.stackdump" is only thing that printed to console. Here is my code. #include <stdio.h> int main() { FILE *fp; char buff[255]; fp = fopen("moby_dick.txt", "r"); printf("%c\n", fgetc(fp)); fscanf(fp, "%s", buff); printf("1 … |
|
I made first board, but when I use function next_generation, it prints wrong result. For example, since first board is 01000 00100 11100 00000 00000, next one should be 00000 10100 01100 01000 00000 . But my program prints 00000 00100 01100 00000 00000. Here is my code. #include <stdio.h> … |