Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- /* run this program using the console pauser or add your own getch, system("pause") or input loop */
- int main(int argc, char *argv[]) {
- char *tab;
- FILE *p;
- tab = malloc(150*sizeof(char));
- if((p = fopen("pliki2.txt","a")) == NULL){
- printf("GUWNO\n");
- exit(1);
- }
- int i = 0,j = 0;
- while(i != 1) {
- scanf("%c",&tab[j]);
- fprintf(p,"%c",tab[j]);
- if(tab[j] == '.'){
- i++;
- j++;
- }
- else{
- j++;
- }
- }
- free(tab);
- fclose(p);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement