#include<iostream>
void swap(int* x, int* y)
{
int tmp = *x; *x=*y; *y=tmp;
}
int main()
{
int a=2, b=4;
std::cout<<"a="<<a<<", b="<<b<<std::endl;
swap(&a, &b);
std::cout<<"a="<<a<<", b="<<b<<std::endl;
}
I believe, you can use C-function - printf().
In C there are functions only, In Java methodsonly (static methods as well), in C++ both.
use the _itoa function
A self-referential function in C++, or in any other supporting language, is a recursive function.
C++ is easier to use as you have to learn slightly less and script slightly to make your function(s) work.
It is not a reserved word, so can be an identifier (name of a type/variable/function).
I believe, you can use C-function - printf().
In C there are functions only, In Java methodsonly (static methods as well), in C++ both.
use the _itoa function
A self-referential function in C++, or in any other supporting language, is a recursive function.
void swap(int& a, int& b ) { a^=b^=a^=b; }
C++ is easier to use as you have to learn slightly less and script slightly to make your function(s) work.
There is no such term as "building function" in C++.
C++ is related to C, the language from which it is derived.
C++ is a compiled language, not an interpreted language.
C++ is generally a compiled language.
bubble_sort (int N, int *A) { int i; swap = 1; while (swap) { swap = 0; for (i=0; i<N-1; ++i) { if (A[i] > A[i+1]) { swap = 1; A[i] ^= A[i+1]; A[i+1] ^= A[i]; A[i] ^= A[i+1]; } } } }