Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Stringstream in C++

Nishtha Thakur
Answered 1d 12h ago

Here we will see the string stream in C++. The string stream associates a string object with a string. Using this we can read from string as if it were a stream like cin.The Stringstream has different methods. These are like below −clear(): Used to clear the streamstr(): To get ... Read More

Reverse a string in C/C++ using Client Server model

Smita Kapse
Answered 1d 12h ago

Here we will see how we can create a system, where we will create one client, and a server, and the client can send one string to the server, and the server will reverse the string, and return back to the client.Here we will use the concept of socket programming. ... Read More

How to write your own header file in C?

Nishtha Thakur
Answered 2d 10h ago

Here we will see how to create own header file using C. To make a header file, we have to create one file with a name, and extension should be (*.h). In that function there will be no main() function. In that file, we can put some variables, some functions ... Read More

How to use POSIX semaphores in C language

Smita Kapse
Answered 2d 10h ago

The semaphore is a concept of process or thread synchronization. Here we will see how to use the semaphores in real programs.In Linux system, we can get the POSIX semaphore library. To use it, we have to include semaphores.h library. We have to compile the code using the following options.gcc ... Read More

Self Destructing Code in C

Anvi Jain
Answered 2d 10h ago

Here we will see how to create self-destructing code in C. The self-destructing code is basically executing the code, and then remove the executable file after executing it.This task is very simple. We need to get the executable file name to remove it. We can use the command line arguments. ... Read More

Generalized Lambda Expressions in C++14

Nishtha Thakur
Answered 2d 10h ago

In C++11, the lambda was introduced. Lambdas are basically a part of code, that can be nested inside other function call statements. By combining lambda expressions with the auto keyword, they can be used later.In C++14, these lambda expressions are improved. Here we can get the generalized lambda. For example, ... Read More

Generating random number in a range in C

Smita Kapse
Answered 2d 10h ago

Here we will see how to generate random number in given range using C. To solve this problem, we will use the srand() function. The current time will be used to seed the srad() function.This function cannot generate random number in any range, it can generate number between 0 to ... Read More

Measure execution time with high precision in C/C++

Anvi Jain
Answered 2d 10h ago

To create high precision timer we can use the chrono library. This library has high resolution clock. This can count in nanoseconds.In this program we will see the execution time in nanoseconds. We will take the time value at first, then another time value at the last, then find the ... Read More

How to find Segmentation Error in C & C++ ? (Using GDB)

Nishtha Thakur
Answered 2d 10h ago

The segmentation error is one of the runtime error, that is caused because of the memory access violation, like accessing invalid array index, pointing some restricted address etc. In this article, we will see how to detect this type of error using the GDB tool.Let us see the code and ... Read More

mbrtowc() function in C/C++

Smita Kapse
Answered 2d 10h ago

This mbrtowc() function is used to convert multibyte sequence to wide character string. This returns the length of the multibyte characters in byte. The syntax is like below.mbrtowc (wchar_t* wc, const char* s, size_t max, mbstate_t* ps)The arguments are −wc is the pointer which points where the resulting wide character ... Read More

getopt() function in C to parse command line arguments

Nishtha Thakur
Answered 2d 10h ago

The getopt() is one of the built-in C function that are used for taking the command line options. The syntax of this function is like below −getopt(int argc, char *const argv[], const char *optstring)The opstring is a list of characters. Each of them representing a single character option.This function returns ... Read More

Errors in C/C++

Smita Kapse
Answered 2d 10h ago

In C or C++, we face different kinds of errors. These errors can be categorized into five different types. These are like below −Syntax ErrorRun-Time ErrorLinker ErrorLogical ErrorSemantic ErrorLet us see these errors one by one −Syntax errorThis kind of errors are occurred, when it violates the rule of C++ ... Read More

Comparator function of qsort() in C

Anvi Jain
Answered 2d 11h ago

In C, we get the qsort() function. This is used to sort some array using quicksort technique. In this function we have to pass the comparator function. This comparator function takes two arguments. Then compares them and get the relative order between them. These two arguments are pointers, and type ... Read More

C++ Program to Implement Trie

Nishtha Thakur
Answered 2d 11h ago

Here we shall discuss a C++ Program to implement Trie. It is a tree based data structure, used for efficient retrieval of a key in a large data-set of strings.Functions and pseudocodesBegin function insert() :    If key not present, inserts key into trie. If the key is prefix of ... Read More

C++ Program to Find number of Ways to Partition a word such that each word is a Palindrome

Smita Kapse
Answered 2d 11h ago

Here we shall discuss a C++ Program to find number of ways to Partition a word in such a way that each word is a Palindrome.AlgorithmsBegin    Take the word as input.    Function partitionadd(vector<vector<string> > &u, string &s, vector<string> &tmp, int index):    if (index == 0)     ... Read More

Previous 1 ... 4 5 6 7 8 9 10 ... 1346 Next
Advertisements
Loading...
Unanswered Questions View All

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.