Hola flony.
Código C++:
Ver original#include<iostream>
#include<fstream>
#include<string>
#include<cstdlib>
using namespace std;
int main()
{
ifstream miArchivo ("nombres.txt", ifstream::in);
string linea, nombre;
bool found = false;
if (!miArchivo.is_open()) {
cout << "Error abriendo nombres.txt";
return EXIT_FAILURE;
}
cout << "ingrese el nombre buscado: ";
getline(cin, nombre);
while (getline(miArchivo, linea, ','))
if (linea.find(nombre) != string::npos)
found = true;
if (found)
cout << "el nombre buscado esta presente ";
else
cout << "el nombre buscado no esta presente";
miArchivo.close();
return EXIT_SUCCESS;
}
Saludos