Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.55 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include "erzeugen.h"
  4. #define CHARL 150
  5.  
  6.  
  7. char line[CHARL];
  8.  
  9.  
  10. void readtxt()
  11. {  
  12.     FILE* fp = fopen("bw.txt","r");
  13.     while(fgets(line, CHARL, fp) != NULL)
  14.     {
  15.         char *wort;
  16.         char *wort2;
  17.         wort = strtok(line, ":");
  18.         printf("%s \n", wort);
  19.         insertKnoten(wort);
  20.         while(strcmp(wort, "\n") != 0)
  21.         {
  22.             printf("%s \n", wort2);
  23.             wort2 = strtok(NULL, ":");
  24.             insertKnoten(wort2);
  25.             insertKante(wort, wort2);
  26.         }
  27.         //if(wort != "") insertKnoten(wort)            
  28.     }
  29.  
  30.  
  31.  
  32. }
  33.  
  34. int main(){
  35.     readtxt();
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement