I don't know about the last two but the first shouldn't matter if you are writing in proper c++ syntax. However, it is used as arguements for scanf and printing variable values in printf
"%[^\n]" is a format specifier for the scanf() family of functions, which instructs it to read successive characters from the input until the end of line (or end of input), storing them in successive positions of a character array. Pointer to the first element of that character array is expected as the argument to such scanf(). After reaching the \n or end of input, scanf() will store an additional null character in the array. The \n will remain in the input stream, unprocessed.
Note that just like %s, this format specifier should never be used without providing the length of the buffer (minus one, to account for the null), e.g.
1 2 3 4 5 6 7
#include<stdio.h>
int main()
{
char s[10];
scanf("%9[^\n]", s);
puts(s);
}