Write a C program that follows these guidelines:
// File tools.h
#include <iostream>
#include <cctype>
// File program1.cpp
#include "tools.h"
int main() {
char array[26];
int count = 0;
std::cout << "Program 1: A List Of Letters Used" << std::endl;
std::cout << "John Doe" << std::endl;
while (true) {
char ch;
std::cin >> ch;
if (ch == '#') {
break;
}
if (!std::isalpha(ch)) {
continue;
}
if (std::isupper(ch)) {
ch = std::tolower(ch);
}
for (int i=0; i<count; i++) {
if (ch == array[i]) {
continue;
}
}
array[count++] = ch;
}
return 0;
}
Comments
Leave a comment