Which keyword is used to define a function in C++? 

  • class 
  • struct 
  • define 
  • void
In C++, the keyword to define a function isn't necessarily a specific reserved word like "class" or "struct". Instead, functions begin with their return type, such as "void" for functions that don't return any value. But it's worth noting that "void" is just one possible return type, and not strictly a keyword exclusively for function definition.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *