Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

74647464

  • 4 years ago

HI WHAT IS THE WAY TO PASS THE OBJECT IN TO THE FUNCTION IN C++ PROG. LANGUAGE.

  • This Question is Closed
  1. kungas
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 2

    void foo(string& ref) { for(int i = 0; i < bar.size(); ++i) { std::cout << ref.at(i) << std::endl; } } string bar = "bar"; foo(bar);

  2. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy