I got stuck with creating 2 functions:
- bool oneAt(char email[] ); - to check if each email has ONLY one “@” character.
- bool oneDot(char* email); - to check if each email has ONLY one “.” (dot).
Can somebody help?
Here's my code:
- bool oneAt(char email[] ); - to check if each email has ONLY one “@” character.
- bool oneDot(char* email); - to check if each email has ONLY one “.” (dot).
Can somebody help?
Here's my code:
Code:
#include <iostream> #include <fstream> #include <cstring> #include <sstream> #include <stdlib.h> using namespace std; bool oneAt(char email[]); const unsigned MaxRecLen = 80; const unsigned MaxFileName = 200; int main() { ifstream inF; ofstream of; char infile[ MaxFileName + 1 ], outfile [ MaxFileName + 1 ]; char email [ MaxRecLen ]; cout << "Enter File Name: "; cin >> infile; cout << "Output File: "; cin >> outfile; inF.open( infile ); of.open( outfile ); inF.getline (email, MaxRecLen ); while (strlen(email)){ if(strlen(email) < 0){ } of << email << endl; inF.getline(email, MaxRecLen); } inF.close(); of.close(); return 0; }
Comment