Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8823423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:21:06+00:00 2026-06-14T06:21:06+00:00

How do you declare a function defined as such: void func(cv::Mat &img) { …

  • 0

How do you declare a function defined as such:

void func(cv::Mat &img)
{
    ...
}

More details:

I defined the function “func” in my main.cpp file below the “main” function. The compiler complained that it didn’t know what the function “func” was, so I tried to put the prototype above the “main” function.

I tried

void func(cv::Mat);

but that didn’t work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T06:21:07+00:00Added an answer on June 14, 2026 at 6:21 am

    Declare?

    Just

    void func(cv::Mat &img);
    

    and that’s it. Or even just

    void func(cv::Mat &);
    

    since parameter names in non-defining declarations serve no purpose (aside from making the code more readable).

    However, for most entities in C++ (and C) a definition is just a specific kind of declaration (i.e. the term “definition” can be thought of as just a shorthand for “defining declaration”). By defining this function you also declared it (for the code that follows the definition).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can forward declare a function in a namespace by doing this: void myNamespace::doThing();
can we declare a function in a header file in following way? extern int
If a function is declared as such: namespace foo { void bar(); } Most
Original Working VB_Code Private Declare Function ConnectReader Lib rfidhid.dll () As Integer Private Declare
If I declare a function virtual in the base non-QObject class and then overlaod
When I don't declare a function protype and have a single function, it runs.
I am a little bit confused by the PHP function declare . What exactly
Say I declare a lua function using the : operator like so: function ClassName:myFunc(
I was trying to declare a callback function in class and then somewhere i
In the following example, I tried to use uninterpreted Boolean function like (declare-const p

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.