My code is here:
char* kropecka(char* tab)
{
int a=0,b=0;
char* zwr;
zwr=(char*)malloc(30*sizeof(char));
for(a;strlen(tab);a++)
{
if(tab[a]!='.')
{
if(isupper(tab[a]))
zwr[b]=tolower(tab[a]);
if(islower(tab[a]))
zwr[b]=toupper(tab[a]);
b++;
}
}
zwr[b]='\0';
return zwr;
}
There is no errors, warnings or something like this. But program crashed when I give him some string:
--------------------------- Microsoft Visual C++ Debug Library --------------------------- Debug Assertion Failed!
Program: ...s\Visual Studio 2010\Projects\C_homework\Debug\C_homework.exe File: f:\dd\vctools\crt_bld\self_x86\crt\src\isctype.c Line: 56
Expression: (unsigned)(c + 1) <= 256
For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts.
(Press Retry to debug the application)
--------------------------- Abort Retry Ignore
Compilator: Visual Studio 2010 Included libary: stdio.h, string.h, ctype.h, stdlib.h (for system() function in main() ).