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 7566091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:19:28+00:00 2026-05-30T14:19:28+00:00

$ cat -n cons.cpp 1 #include <iostream> 2 3 using namespace std; 4 5

  • 0
$ cat -n cons.cpp
     1  #include <iostream>
     2
     3  using namespace std;
     4
     5  int return1() {
     6      return 1;
     7  }
     8
     9  int main() {
    10      cout<< return1.m_one << endl;
    11      return 0;
    12  }
$ g++ cons.cpp
cons.cpp: In function 'int main()':
cons.cpp:10: error: request for member 'm_one' in 'return1',
             which is of non-class type 'int ()()'
$

Maybe this is compiler specific, but is there some significance / meaning of the extra pair of brackets in int ()() as reported by g++ above?

  • 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-05-30T14:19:29+00:00Added an answer on May 30, 2026 at 2:19 pm

    The idea of this syntax is this:

    • The inner pair of brackets means I am a function
    • The int on the left side means My return type is int
    • The right pair of brackets means I take no arguments

    Hence if the function had been declared as

    int return1(int a)
    

    the error message would talk about int ()(int).

    But the way the function type is represented indeed depends on the compiler as well as the version. E.g. GCC 4.5.1 which I just tried simply said int() as you suggested as more intuitive.

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

Sidebar

Related Questions

$ cat inheritance.cpp #include <iostream> using namespace std; class A { }; class B
[root@ test]$ cat return10.c #include <stdio.h> int main(int argc, char *argv[]){ return 10; }
$ cat t.cpp int sign(int i) { if(i > 0) return 1; if(i ==
cat main.c #include <stdio.h> #include <stdlib.h> #include <linux/ext2_fs.h> int main(int argc, char** argv) {
// main.cpp class Cat() { public: Cat() { a = 0; (*b) = 0;
$ cat Const.java public class Const { String Const(String hello) { return hello; }
I want to cat all the files in a directory, but include some spacer
I am using cat *.txt to merge multiple txt files into one, but I
Is there a command like cat in linux which can return a specified quantity
% CAT(2,A,B) is the same as [A,B]. % CAT(1,A,B) is the same as [A;B].

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.