iam a noob at c++ and trying to learn it so go easy on me.
basically i am trying to enter a some letters such as 'helody' and then check the letters it has in it and place the remaining letters of the alpahebet after it.
so afterwords it would look like:
helodyabcfghij.....etc
here is what i have tried but it just crashes on me after i enter some characters.
can someone point out where iam going wrong please
**edit iam testing it with only a few letters thats why the counter is 5
#include <iostream>
#include <cstdio>
#include <string>
using namespace std;
int counter = 5;
char key [30];
char alpha [] = "abcdefghijklmnopqrstuvwxyz";
char nextchar;
int main()
{
cin >> key;
for (int i=0; i<counter; i++)
{
for (int f = 0; f<25; f++)
{
if (key[i] != alpha[f])
{
counter++;
key[counter] = alpha[f];
}
}
}
return 0;
}