-2

I am making a simple encryption program, but I can't get the return function right. I want to replace the [ with \n. But I can't get this to work. This is my current solution:

#include <string>
#include <iostream>
#include <algorithm>
#include <fstream>

std::ifstream in("file.txt");
std::ofstream out("result.txt");

std::string line;
while (!in.eof())
{
    std::getline(in, line);
    std::replace(line.begin(), line.end(), "[", "\n");
    out << line;
}
NekoLuka
  • 82
  • 6

1 Answers1

2

Replace " with '

This means you have to use character instead of string. This is working at my side.

@Blaze