Hi everyone

I want to open the Directory like this using C++ in linux

eg : /proc/1/status

where proc and 1 is a directory and status is a file,which i want to access(i.e)this file i have to copy to an string to access some information..................can anyone help

use ifstream. Assuming status is a file and not a directory it would be like this

#include <fstreeam>
using std::ifstream;

int main()
{
   ifstream in("./proc/1/status");
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.