I think the problem is here. ': :' is a character constant as it is contained in single inverted commas. However, you have put three characters inside it. A character constant must contain one character only.
'/n'
What is this for? It doesn't seem to do anything and the semicolon is missing. (Also, is this supposed to be an escaped newline character '\n'?)
I put the semicolon after '/n' and changed '/n' to '\n' and no longer receive the error.
However, my programme still isn't doing what it's supposed to.
The programme is intended to read a txt file (example.txt). The file contains extremely long lines of text. Where a new line should be, the text file contains the characters : :
The programme should be finding those : : instances and creating a new line in the output instead.
Although I get no errors now, the programme does not create a new line instead of the : :. It merely outputs the whole long line.
Firstly, I don't think line[i] == ': :' does what you are expecting.
The single quote marks are for characters, and you are checking a single character of your string for three characters. Clearly this doesn't make sense ;)
Instead you need to compare three characters of your line variable to the string literal ": :".
As for replacing the ": :" with a newline character, you may need to rethink your method for that too. Just writing a line '\n'; does absolutely nothing :(