sharing everything

Posts in category C++/Qt

C++ : Split String By Separator

This code show a simple method how to split string in C++. The output from this code split string in C++ are in vector<string>. Please check Split String in C++ below :

Save that file to split_string.cpp. Compile code using command :

Running split string in C++ by command :

Source : […]

C/C++ : datenum code

Matlab have a function to convert string of date to double number. This double number represent preset day from (January 0, 0000). This function name is “datenum”. I want to use this function in C/C++.  I have research this function and create a simple code how to use datenum in our C/C++ code (convert datenum […]

C/C++ : Get Current Time

Using Matlab, we can get the current date and time using “now” command.  Example, using Matlab  we can use below command :

How if we want to get current time using C/C++ with the result like Matlab ? We can use “localtime” to get date and time in C/C++  and use gettimeofday to get […]

C/C++ : Adding Searching Include Dire...

I have compiled a source code (Opendtect) using CMake. When I compile this program, the required include directory is not exist in the C/C++ searching path. Modified the Makefile is very hard, because this is the other people code. We can copy all the include library to default C/C++ include directory (/usr/include). But, I dont […]

Categories

Bloggers - Meet Millions of Bloggers