Tutorialspoint

R vs Python in Data Science

Samual Sam
Answered on 8th Nov, 2018

Overview of Data Science When we work on set of data then we apply different statistical functions on that dataset. These functions we use for an extensive exploration of descriptive statistics, statistical tests, plotting functions etc. Data science is actually a multidisciplinary exploration of algorithmic development, data inference and technology ... Read More

When to use references vs. pointers in C/C++

karthikeya Boyini
Answered on 8th Nov, 2018

Reference variable Reference variable is an alternate name of already existed variable. It cannot be changed to refer another variable and should be initialized at the time of declaration. It cannot be NULL. The operator ‘&’ is used to declare a reference variable. The following is the syntax of reference ... Read More

What is the size of an object of an empty class in C++?

Samual Sam
Answered on 8th Nov, 2018

The following is an example to find the size of object of an empty class. Example Live Demo #include <bits/stdc++.h> using namespace std; class p1 { public: void first() { cout << "\nThe parent class ... Read More

How to call a parent class function from derived class function in C++?

karthikeya Boyini
Answered on 8th Nov, 2018

The following is an example to call parent class function from derived class function. Example Live Demo #include <bits/stdc++.h> using namespace std; class p1 { public: void first() { cout << "\nThe parent class p1 function ... Read More

When to use extern in C/C++

Samual Sam
Answered on 8th Nov, 2018

External variables are also known as global variables. These variables are defined outside the function and are available globally throughout the function execution. The “extern” keyword is used to declare and define the external variables. The keyword [ extern “C” ] is used to declare functions in C++ which ... Read More

What is a reference variable in C++?

karthikeya Boyini
Answered on 8th Nov, 2018

Reference variable is an alternate name of already existing variable. It cannot be changed to refer another variable and should be initialized at the time of declaration and cannot be NULL. The operator ‘&’ is used to declare reference variable. The following is the syntax of reference variable. datatype ... Read More

What is the difference between an int and a long in C++?

Samual Sam
Answered on 8th Nov, 2018

int The datatype int is used to store the integer values. It could be signed or unsigned. The datatype int is of 32-bit or 4 bytes. It requires less memory area than long to store a value. The keyword “int” is used to declare an integer variable. The following is ... Read More

What is the correct way to use printf to print a size_t in C/C++?

karthikeya Boyini
Answered on 8th Nov, 2018

We should use “%zu” to print the variables of size_t length. We can use “%d” also to print size_t variables, it will not show any error. The correct way to print size_t variables is use of “%zu”. In “%zu” format, z is a length modifier and u stand for unsigned ... Read More

What is the difference between g++ and gcc?

Samual Sam
Answered on 8th Nov, 2018

g++ GNU C++ Compiler ( g++ ) is a compiler in Linux which is used to compile C++ programs. It compiles both files with extension .c and .cpp as C++ files. The following is the compiler command to compile C++ program. g++ program.cpp -o filename Here, ... Read More

Where are static variables stored in C/C++?

karthikeya Boyini
Answered on 8th Nov, 2018

Static variables are variables that remain in memory while the program is running i.e. their lifetime is the entire program run. This is different than automatic variables as they remain in memory only when their function is running and are destroyed when the function is over. The static variables are ... Read More

Pre-increment and Post-increment concept in C/C++?

Samual Sam
Answered on 8th Nov, 2018

Increment operators are used to increase the value by one while decrement works opposite increment. Decrement operator decrease the value by one. Pre-increment (++i) − Before assigning the value to the variable, the value is incremented by one. Post-increment (i++) − After assigning the value to the variable, the value ... Read More

How to sum two integers without using arithmetic operators in C/C++?

karthikeya Boyini
Answered on 8th Nov, 2018

The following is an example to add two numbers without using arithmetic operators. Example Live Demo #include <iostream> #include <cmath> using namespace std; int add(int val1, int val2) { while(val2 != 0) { int c = val1 & val2; ... Read More

How to convert a single char into an int in C++

Samual Sam
Answered on 8th Nov, 2018

The following is an example to convert a character into int. Example Live Demo #include <iostream> using namespace std; int main() { char c = '8'; int i = c - 48; cout << i; i ... Read More

How to return an array from a function in C++?

karthikeya Boyini
Answered on 8th Nov, 2018

C++ does not return entire array but it can return pointer to an array. Outside the function, address of local variable cannot be returned. By making local variable static, it can return the address of local variable. The following is the syntax to return a pointer. int * function_name() ... Read More

Why does C++ require a cast for malloc() but C doesn't?

Samual Sam
Answered on 8th Nov, 2018

In C language, the void pointers are converted implicitly to the object pointer type. The function malloc() returns void * in C89 standard. In earlier versions of C, malloc() returns char *. In C++ language, by default malloc() returns int value. So, the pointers are converted to object pointers using ... Read More

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.