// This will be a simple example for Matlab programming in C
// But I have to first test the C program before I incorporate it into
Matlab
char *encrypt_string (char *string)
{
unsigned int i;
// Allocate memory
char *encrypted_stri ng = (char *)
malloc(strlen(s tring)*sizeof(c har));
// Encrypt the string
for (i = 0; i < strlen(string); ++i)
{
encrypted_strin g[i] = encrypt_char(st ring[i]);
}
encrypted_strin g[i] = "\0"; <------------- Something goes wrong
warning C4047
return encrypted_strin g;
}
------------------Anzahl der Dereferenzierun gen bei 'char' und 'char
[2]' unterschiedlich
// But I have to first test the C program before I incorporate it into
Matlab
char *encrypt_string (char *string)
{
unsigned int i;
// Allocate memory
char *encrypted_stri ng = (char *)
malloc(strlen(s tring)*sizeof(c har));
// Encrypt the string
for (i = 0; i < strlen(string); ++i)
{
encrypted_strin g[i] = encrypt_char(st ring[i]);
}
encrypted_strin g[i] = "\0"; <------------- Something goes wrong
warning C4047
return encrypted_strin g;
}
------------------Anzahl der Dereferenzierun gen bei 'char' und 'char
[2]' unterschiedlich
Comment