Search
 
SCRIPT & CODE EXAMPLE
 

CPP

C++ passing function arguments to a thread

void randVals(int val, char* str, double dblval)
{
  cout << val << " " << str <<" " << dblval << endl;
}

/**************************************************/

char* str = "Hello World!";

thread thread1(randVals, 3, str, 7.7);

if (thread1.joinable())
{
thread1.join();
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: addition without arithmetic operators c++ 
Cpp :: Modulo Exponentiaon,Iteratve Modulo Exponentiation 
Cpp :: c++ loop pyramid 
Cpp :: using find in vector c++ 
Cpp :: function as argument in another function in c++ 
Cpp :: how to read a line from the console in c++ 
Cpp :: how to make a hello world program in c++ 
Cpp :: how to hide the c++ console 
Cpp :: c++ create threads 
Cpp :: check if point is left or right of vector 
Cpp :: c++ fibonacci 
Cpp :: how to make a n*n 2d dynamic array in c++ 
Cpp :: kruskal in c++ 
Cpp :: c++ ros publisher 
Cpp :: pow in c++ 
Cpp :: c++ print vector without loop 
Cpp :: c++ iterate over vector 
Cpp :: c++ hours minutes seconds 
Cpp :: random number cpp 
Cpp :: length of string c++ 
Cpp :: insert vector to end of vector c++ 
Cpp :: SetUnhandledExceptionFilter 
Cpp :: delete a node from binery search tree c++ 
Cpp :: round up 2 digits float c++ 
Cpp :: char ascii c++ 
Cpp :: c++ cast char to string 
Cpp :: append string cpp 
Cpp :: c++ Sum of all the factors of a number 
Cpp :: how to declare a 2d boolean vector in c++ 
Cpp :: sort vector struct c++ 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =