Hi. I was wondering if I could get another quick question answered real quick (I hope I'm not already wearing out my welcome :)
I'm trundling my way through Bucky's C++ tutorials on youtube, and he's introduced the concept of arrays, specifically character arrays and the cin.getline() statement.
I've entered a program into a compiler which inputs a name and displays it on the screen, using the cin.getline statement. The code snippet is below.
First, you have forgotten to include <iostream>, though that isn't relevant to your program. What is going on isn't to do with the code, but rather the outside OS. For some reason, the file you are compiling to is read-only, or is in an otherwise unwritable state. For example, if you already have the program open, close it and try again.
<iostream> is necessary to realize " cin / cout " streams. It contains function prototypes for the C++ standard input and output functions. You can use <cstdio> too, it contains function prototypes for the C-style standard input/output library functions ( " scanf / printf " ).