hello all, i have problems implementing a path for the following program
well , the prototype says it only accepts , *char and char! no string! so im stuck!
im talking about this (
Code:
std::ifstream f(path, std::ios::binary);
)
I dont know how to get it to work!
Code:
#include <iostream>
#include <fstream>
#include <iomanip>
#include <string>
using namespace std;
int main()
{
unsigned char c;
string path;
char *route;
cin>>route;
std::ifstream f(route, std::ios::binary);
while (f >> c)
{
std::cout << std::hex << std::setw(2) << std::setfill('0') << (unsigned int)c <<" ";//or << (unsigned int)c << "\t"
}
return 0;
}
Code:
std::ifstream f(route, std::ios::binary);
either This is not working,
it compiles well, but , at run time when you enter a path! and press enter! it crashes! really dont know how to go about it!