All pastes #839583 Raw Edit

Something

public text v1 · immutable
#839583 ·published 2007-12-31 02:43 UTC
rendered paste body

#define MAX_LEN 5

int main(void) {

  char chckDrv[1024] = "C:\\\0Alangeslaufwerk:\\\0E:\\\0\0nurnochdatenmuell\0test";

  int chckDrvP = 0;
  int strP = 0;
  char str[8]; 

  while(chckDrvP != 1024) { 
    str[strP] = chckDrv[chckDrvP];
    if(strP > MAX_LEN) {
      printf("String zu lang!!!! %s\n", str);
      while(chckDrv[chckDrvP] && chckDrvP != 1024) chckDrvP++; // naechsten substring suchen...
    }   
    if(!chckDrv[chckDrvP]) {
      if(!str[0]) break;
      printf("Laufwerk: %s, Strinlaenge: %i\n", str, strP);
      strP = 0;  
    } else strP++;
    
    chckDrvP++;
  }

  return 0;
}