c++11 - How to access functionality of both GPU & SoundCard Chip directly from C++? -
this question has answer here:
- c++ const usage explanation 12 answers
i student,learning c++ concurrency programming.i want know how access functionality both graphic card chip , sound card chip through c++ program.is there way connect respective drivers , application without using external libraries such opengl,openal etc.can briefly describe solution example. thank you.
const int * const function_name(const int * point) const; //(1) (2) (3) (4)
the first prevents returned pointer being used modify whatever data being accessed function. (unless want modify it), since prevents unexpected modification of shared data.
the second prevents caller modifying returned pointer. has no effect when returning built-in type (like pointer), , can bad when returning class type since inhibits move semantics.
the third prevents function modifying data. (when appropriate) same reason first.
the fourth prevents function modifying (non-mutable) state of object. (when appropriate) allows function called on const
objects, , makes easier keep track of when object might change.
const int * const functiontwo(const int * const &) const; // (5)
the new thing here passing pointer const
reference. there's no point in doing that; passing value gives same semantics, , less verbose , more efficient. passing const
reference can more efficient passing value types large or otherwise expensive copy.
a slight variation pass const
value:
const int * const functiontwo(const int * const) const; // (6)
this of no interest caller (indeed, function can declared or without without changing meaning); there's no point putting on declaration, on definition. means pointer can't change within function. can (as can declaring local variables const
), can make function implementation easier follow.
Comments
Post a Comment