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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:18:02+00:00 2026-05-27T07:18:02+00:00

#include <iostream> std::string getMyName(void) { std:: cout << This is function getMyName << std::endl;

  • 0
#include <iostream>

std::string getMyName(void)
{
  std:: cout << "This is function getMyName" << std::endl;
  return std::string("hello world");
}

std::string getMyName2(void)
{
  std:: cout << "This is function getMyName2" << std::endl;
  return std::string("hello world2");
}

int main(void)
{
  // what is the official name for the following syntax?
  bool isDone = (getMyName(), getMyName2(), false);

  std:: cout << "isDone " << isDone << std::endl;
  return 0;
}

user@ubuntu:~/Documents/C++$ ./period 
This is function getMyName
This is function getMyName2
isDone 0

As you can see the following statement is evaluated from left to right and the value of isDone is assigned with the last expression of value false.

bool isDone = (getMyName(), getMyName2(), false);

I would like to know the official syntax name for this statement. I have searched ‘period statement’ through G and without meaningful hits.

Thank you

  • 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-27T07:18:02+00:00Added an answer on May 27, 2026 at 7:18 am

    You are making use of the comma operator

    • http://en.wikipedia.org/wiki/Comma_operator

    This operator will evaluate the left expression first, then evaluate the second and use it’s result as the result of the expression. It’s roughly equivalent to

    getMyName();
    getMyName2();
    bool isDone = false;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; int main(void) {
#include <iostream> using namespace std; class Base { public: Base(){cout <<Base<<endl;} virtual ~Base(){cout<<~Base<<endl;} virtual
How would you unit test do_int_to_string_conversion? #include <string> #include <iostream> void do_int_to_string_conversion(int i, std::string&
I have this puny program. #include <iostream> #include <string> int main() { std::string st
This code: #include <iostream> #include <cstdio> #include <fstream> #include <string> int main() { std::remove(test.txt);
header.h #include <iostream> #include <vector> class CombatLine{ std::stringstream Line; std::vector<std::string> TokenLine; void SetLine(std::string s){
#include <iostream> using namespace std; template<typename T> void test() { cout << 1; }
#include <iostream> using namespace std; double prompt(string input ) { double input; cin>>input; return
I have the following code: #include <iostream> #include <string> void main() { std::string str;
Consider this example: #include <algorithm> #include <iostream> int main() { std::string str = abcde4fghijk4l5mnopqrs6t8uvwxyz;

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.