0

I am getting an error i dont recognize and dont know what to do to fix it and input would be great. The error is:

prog4.cpp:23: error: no matching function for call to 'std::basic_istream<char, std::char_traits<char> >::get(char [500])'
#include <iostream>
#include <ctype.h>
#include <cstring>

using namespace std;

void encrypt(char ch, int count, int num, char phrase[]);

int main()
{
        char ch, phrase[500];
        int count, i, num, flag = 0;

        cout << "Please enter a phrase you wish to be encrypted then press enter.";
        cin >> phrase;
        cout << "Enter you favorite number to encrypt phrase with.";
        cin >> num;

        count = strlen (phrase);

for (i = 0; i < count; i++)
{
        ch = cin.get(phrase);

        if (ch == '\n')
        {
                break;
        }
        else
        {
                if (ch == ' ')
                {
                        flag = 1;
                        continue;
                }
                else
                {
                        if (flag == 1)
                        {
                                flag = 0;
                                toupper(ch);
                                encrypt(ch, count, num, phrase);
                        }
                encrypt(ch, count, num, phrase);
                }
        }
}
}

void encrypt(char ch, int count, int num, char phrase[])
{
                if (count<=num)
                {
                        cin >> phrase;
                        ch = cin.get();
                        ch = ch + count;
                        count++;
                }

                else
                {
                        count = 1;
                        cin >> phrase;
                        ch = cin.get();
                        ch = count + ch;
                        count ++;
                }

}
2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by Ancient Dragon
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.