Thanks L B! These must be a hidden error at somewhere in the function STRCAT.
Because also the default C++ code cannot solve this, and the returning value most likely is undefined. Just call it "UNDEFINED BEHAVIOR"
NEW TYPE-CAST!!!! Users now can use and apply type-cast directly for a value by using the form looks like : int(...); char(...); unsigned int(...);. As you can see this looks like a function, and I used this tweak to make this.
NOTE : Still useless if you write (int)(10 * 22.2) //It should be a function
1 2
double d = 100;
int m = int(d = modf(87.55, &d));
At least in my opinion it's better than :
int m = [int](d = modf(87.55, &d));
I have no idea should I remove the ugly bracket [] form? Any idea or suggestion?
These must be a hidden error at somewhere in the function STRCAT.
Because also the default C++ code cannot solve this, and the returning value most likely is undefined. Just call it "UNDEFINED BEHAVIOR"
Oh I'm sorry, there was a lot of things and actually I was very confused because I only tried to call strcat. More crazily, I tried to figure out every assembly code and made a similar function strcat. The function works fine, then why does the standard function crashs? So just a few doubt questions. :)
And about pointer, probably I'm not going to make a whole structure for pointers, but I have an idea...
This means that the first parameter cannot be in any way similar to the second, or it will crash. The fact that it doesn't work is defined right there in black and white.
You can't expect someone without legs to be able to run and jump just because their twin brother can.
If you call the function strcat like this, the possible cause : At beggining, the function replaces the terminator null character with the first character of the character array. Then most likely the program will enter an infinite loop - only trying to search the null character (actually the null character has been replaced before). The null character (or the end of string) is never met or reached because both the length of the destination and source string are continuously growing up and up. Finally it causes "overflow". And a crash error begins!!!
This doesn't mean the pointer isn't a lvalue. Anyways are you sure your error shows up with the code you posted? Typecasting enum types always works - and a pointer is a number.