Is it possible to return values from a shell prompt back into c++ as a variable?

IE: If I have the line system("cat *txt"); I am unable to store any of the results within my c++ program.

Thanks!

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.