Bleep C++

This is my code I came up with for the Bleep project in C++. Difference here is that it will take user input and bleep the censored words out of the string. Words that are censored are kept in a vector.


#include "functions.cpp"

using namespace std;

int main() {



#include <bits/stdc++.h> 

using namespace std;

string text_filter(string &word) {
	vector<string> banned = {"test", "tests", "tested", "testing"};

	transform(word.begin(), word.end(), word.begin(), ::tolower);	//make string lowercase

	for (auto& e : banned) {
		if (e == word) {
			word = string(e.length(), '*');

  return word;

void text_filter_print() {

  //Prompt user for input
	cout << "Say something stringy.\n";  
	string line;
  getline(cin, line);
  stringstream stream(line);
  string words;
	while (stream >> words) {
  	cout << text_filter(words) << " ";
	cout << endl;


//Filter out words you want to remove
string text_filter(string &s);

//Print string after after you run text_filter
void text_filter_print();

Compiled this offline in g++ using Linux.