C++ Grammar Questions

Asked 1 weeks ago, Updated 1 weeks ago, 1 views

Hello, I checked the code below while studying open source.

 QString name(void) const { return_name;}
    LinkInterface*  link(void)  { return _link.lock().get(); }

Can we find official documents or articles related to how to declare a function, such as name(void), link(void)?

I wonder if it's to show that there are no parameters explicitly, or if it has a different meaning.

c++ qt qt-designer

2022-09-20 08:46

1 Answers

I can't tell if it's a question about the structure of a function or a question about void, so I'm answering both.

QString name(void) const 
{
    return _name;
}

LinkInterface* link(void)
{
    return _link.lock().get();
}


2022-09-20 08:46

If you have any answers or tips


© 2022 pinfo. All rights reserved.