my program is simply to ask the user for a sentence and then ask them for a character in that sentence and then output the position of the character but for some reason its skipping the get character part and outputting a random position.
#include<iostream>
#include<fstream>
#include<string>
#include<sstream>
int main()
{
std::cout << "please enter a sentence. \n";
std::string line;
std::cin >> line;
std::fstream input;
input.open("input.txt");
input << line;
std::cout << "What character would you like to find? \n";
char ch;
std::cin >> ch;
input.get(ch);
int n = input.tellg();
input.close();
std::cout << "The charachter was in position: " << n
<< " of the file.";
system("pause");
return 0;
}