Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- #include <ctype.h>
- #include <assert.h>
- char * RLEDecompress ( const char * src )
- { int i=0;
- while(src[i]!='/0') // Вот тут уже СЕГ ФАУЛТ. Либо я даже делал что просто вначале функции задавал src=malloc(10000)
- i++; //но это все равно не помогло
- }
- int main ( int argc, char * argv [] )
- {
- char * res;
- assert ( ! strcmp (
- (res = RLEDecompress ( "Hello world!" )),
- "Hello world!" ));
- free ( res );
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment