const *char from file?

Hi All,
I have a function that takes a const *char as input. I do have a written file that I would like to use in the function, but I cannot seem to make a const *char from the file ...
yep, quite new to C & C++

1
2
3
4
5
6
7
8
const char * vsChars ;
void load(){
    std::ifstream ctFile ("G:/...
    size = ctFile.tellg();
    vsChars = new char [size];
    ctFile.read (vsChars, size); //error
    ...
} 


error: invalid conversion from 'const char*' to 'std::basic_istream<char>::char_type* {aka char*}' [-fpermissive]|
...

Is there any way that I can get a compile-time expression for the file-size?
Last edited on
Topic archived. No new replies allowed.