•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 455,985 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,772 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 537 | Replies: 1 | Solved
![]() |
•
•
Join Date: Nov 2007
Posts: 14
Reputation:
Rep Power: 1
Solved Threads: 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 ++;
}
}
![]() |
•
•
•
•
•
•
•
•
DaniWeb C++ Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Disk Utility says, "unknown error -20" (Storage)
- "the messaging interface has returned an unknown error." (Windows Software)
- Error, Cannot Complete Cd Writing Wizard (Windows Software)
- The attempt to burn a disc failed.. An unknown error occured. (4450) (Storage)
- unknown error message keeps appearing!! (Windows NT / 2000 / XP / 2003)
- Outlook Express 6 Error Message (Windows NT / 2000 / XP / 2003)
- windows media player 10 error message (Windows NT / 2000 / XP / 2003)
- Unknown Error when trying to start WindowsXP (Windows NT / 2000 / XP / 2003)
Other Threads in the C++ Forum
- Previous Thread: The For Loop
- Next Thread: error: no matching function for call to 'getline(std::ofstream&, std::string&, char)'



Linear Mode