hello freinds, i have small program as follows char arr[30] = "someString"; strcat(arr,arr); cout<<arr<<endl; when i try to print arr nothing gets printed. Strcat fn should append the string nothing gets appended . please correct if iam wrong some where
> strcat(arr,arr); There are very few standard C functions (memmove being a notable exception) which work reliably when the input and output buffers overlap. In essence, if you change the thing you're reading from, then expect surprises (sometimes the surprise comes years later). This for example is likely to just keep going until it runs off the end of memory (or trashes something) and then it crashes. Since you used cout, why not use std::string for all your strings. It's much safer.