hi to all!
i'm posting for the first time here and also i'm new to c++! So,excuse me a priori. I'm trying to open a file with ifstream like this:
Code:
std::ifstream file("/home/alex/Desktop/csvDumps/"+event->name);
where 'event' is an inotify_event struct and 'name' is defined as char name[]; in this struct.
but i get : "error: invalid operands of types ‘const char [29]’ and ‘char [0]’ to binary ‘operator+’".
Tried to cast event->name by:
Code:
std::ifstream file("/home/alex/Desktop/csvDumps/"+(const char)event->name);
but nothing went right.
Please help!
This code is in a while(1) loop and every time the name of the file to be opened changes. Any other idea for opening the file with an input variable like the one before is accepted!!
thanks in advance!!