mkdir c++ function

If you want to write cross-platform code, you can use boost::filesystem routines This does add a library dependency but chances are you are going to use other filesystem routines as well and boost::filesystem has some great interfaces for that. If you only need to make a new directory and if you are only going to use VS 2008, you … Read more

Iterator Loop vs index loop

The special thing about iterators is that they provide the glue between algorithms and containers. For generic code, the recommendation would be to use a combination of STL algorithms (e.g. find, sort, remove, copy) etc. that carries out the computation that you have in mind on your data structure (vector, list, map etc.), and to supply that algorithm with iterators into your container. … Read more

How does c++ represent negative value

As i know binary equivalent of signed int is 11111111111111111111111111111111and based on this, I’m trying to make Maximum and Minimum int value for my program without using limits.h header file. After run my below code i get Minimum value as -2147483648 and Maximum value is 0. Here below is my code: Whats wrong with my … Read more

Difference between pic Vs pie

From the gcc documentation: -fpicGenerate position-independent code (PIC) suitable for use in a shared library… -fpieThese options are similar to -fpic and -fPIC, but generated position independent code can be only linked into executables….

Why can’t we pass arrays to function by value?

The origin is historical. The problem is that the rule “arrays decay into pointers, when passed to a function” is simple. Copying arrays would be kind of complicated and not very clear, since the behavior would change for different parameters and different function declarations. Note that you can still do an indirect pass by value:

C++ printing boolean, what is displayed?

The standard streams have a boolalpha flag that determines what gets displayed — when it’s false, they’ll display as 0 and 1. When it’s true, they’ll display as false and true. There’s also an std::boolalpha manipulator to set the flag, so this: …produces output like: For what it’s worth, the actual word produced when boolalpha is set to true is localized–that is, <locale> has a num_put category that handles numeric conversions, … Read more

reading from stdin in c++

You have not defined the variable input_line. Add this: And add this include. Here is the full example. I also removed the semi-colon after the while loop, and you should have getline inside the while to properly detect the end of the stream.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)