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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:29:20+00:00 2026-06-10T00:29:20+00:00

Is there any particular problem in converting these kind of code into VS2010(I have

  • 0

Is there any particular problem in converting these kind of code into VS2010(I have to know before I can check it)

Is there any online VS2010 compiler?

What does assert(false); does?

EXAMPLE

    int applyOperator(Operator op,int x,int y)
{
  switch (op) {
    case operator_plus:  return x+y; // jesli operator_plus zwroc x + y itd.
    case operator_minus: return x-y;
    case operator_mul: return x*y;
    case operator_div: return x/y;
    case operator_none:
      break;
  }
  assert(false);
  return 0;
}

#include <iostream>

using namespace std;
#include <iostream>
#include <string>
class Student {
public:
    string Name, ID, Gender, BirthDate, Major;
    friend istream& operator >> (istream& in, Student& s); //DEKLARACJA przeciazenia operatora >> tak bay wczytywal dane linia po linii
    friend ostream& operator<< (ostream&,Student const&);  //DEKLARACJA przeciazenia operatora << tak aby wypisywal obiekty typu Student
};


   istream& operator >> (istream& in, Student& s){
    cout << "Name\n";
    getline (cin,s.Name); //wczytanie linii na imię
    cout <<"ID\n";
    getline (cin,s.ID);   //wczytanie linii na ID
    cout <<"Gender\n";    
    getline (cin,s.Gender);
    cout <<"BirthDate\n";
    getline (cin,s.BirthDate);
    cout <<"Major\n";
    getline (cin,s.Major);
    return in;
    };
ostream& operator<< (ostream &wyjscie, Student const& ex)
{
   wyjscie<<""<<"Name:\t"<<ex.Name<<"\n"<<
    ""<<"Student ID:\t"<<ex.ID<<"\n"<<
    ""<<"Gender:\t"<<ex.Gender<<"\n"<<
    "BirthDate:\t"<<ex.BirthDate<<"\n"<<
    "Major:\t"<<ex.Major<<endl;
    return wyjscie;
}



int main(){
        Student s;
        cin>>s;
        cout<<s;
        return 0;
}
  • 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-10T00:29:22+00:00Added an answer on June 10, 2026 at 12:29 am

    What does assert(false); does?

    It opens an assert window. It’s a mechanism to let the programmer know when a control path that wasn’t supposed to be reached, is, or a condition that wasn’t supposed to fail, does.

    Basically like:

    int divide10ByX(int x)
    {
       if ( x == 0 )
       {
          assert(!"x can't be 0");
          return 0;
       }
       return 10/x;
    }
    

    When x is 0, the program would normally crash. By checking beforehand, you prevent the crash, but can hide some wrong functionality because x isn’t supposed to be 0. So you put an assert there to inform you whenever x is 0.

    Alternitively, it could be assert(x), which only triggers if x==0.

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

Sidebar

Related Questions

Is there any particular way to integrate Captch code validation in iPhone application? is
I have some code for converting some timestamps stored as strings into datetime objects
I have had mysql query to check any particular reservations existing in database .
Is there any particular reason that all data members in a class are private
Is there any way to find particular C language function's input and output parameters
Is there any way in SSIS to identify which particular task has failed? My
Is there any way to tell GCC to not initialize a particular global array
Is there any other command for redirecting a controller to a particular view page
Is there any way to ensure that a class posts a particular NSNotification? (I
Is there any way of caching the bytecode for JSP webapps/ In particular, using

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.