Is there a C++ equivalent to getcwd?

Ok, I’m answering even though you already have accepted an answer. An even better way than to wrap the getcwd call would be to use boost::filesystem, where you get a path object from the current_path() function. The Boost filesystem library allows you to do lots of other useful stuff that you would otherwise need to … Read more

Creating folders in C++

I have recently started working in C++ and came across this situation when I have to create a directory while executing my code. The code is working fine when I have to create a single folder but it fails when I have to create another folder withing this newly created folder. Suppose, I am in … Read more

How can I get the maximum or minimum value in a vector?

How can I get the maximum or minimum value in a vector in C++? And am I wrong in assuming it would be more or less the same with an array? I need an iterator, right? I tried it with max_element, but I kept getting an error.

Categories C++

Function call missing argument list to create pointer

You cannot directly call a non-static class method using this callback. This is because the method is expecting to be called with the class this pointer. If you don’t need any data from your class, then just make the method static. If you do need data from the class, you can make a static “stub” … Read more

What is a nested name specifier?

Related to this I want to know what exactly is a nested name specifier? I looked up in the draft but I could understand the grammar as I haven’t taken any Compiler Design classes yet.