const myName = "BlueBug";
char* name = new char(strlen(string) + 1); //allocate spaces
strcpy_s(newLine, strlen(string)+1, string); //Tada! perfect
//Hey but what if... I do this?
const myNewName = "SuchAVeryLongNameIHave";
strcpy_s(name, strlen(myNewName ) + 1, myNewName );
I am copying my new name to, starting from the location in which….
my previous name has started, but my previous name is a lot shorter than myNewName
Shouldn’t i be yelled at because my previous name was BlueBug,
so I only allocated 8 character lengths… but I am now writing 10+ characters without allocating space
I have 1gb available space in my HDD which is composed of mainly movies and I want to overwrite files with same names and file size. The file that I want to replace is a 2gb movie and I want to replace it with the exact same file but with subtitles because I copy the movie from my HDD to my desktop and put subtitles on it and now I want to replace the movie with no subtitle with it. So my question is does overwriting a file consumes extra space?