"c++ to assembly" Code Answer's

You're definitely familiar with the best coding language C++ that developers use to develop their projects and they get all their queries like "c++ to assembly" answered properly. Developers are finding an appropriate answer about c++ to assembly related to the C++ coding language. By visiting this online portal developers get answers concerning C++ codes question like c++ to assembly. Enter your desired code related query in the search bar and get every piece of information about C++ code related question on c++ to assembly. 

c++ convert to assembly language

By Alive AlbatrossAlive Albatross on Mar 05, 2021
$ gcc -S geeks.c

Source: tutorialspoint.dev

Add Comment

0

c++ to assembly

By Alive AlbatrossAlive Albatross on Mar 05, 2021
#include <iostream>
#include <fstream>

using namespace std;

#define FILENAME "data.bin"

void what_action();

void register_menu();
void login_menu();

void add_user(string username, string password);
bool check_user(string username, string password);

int main()
{
    what_action();
}

void what_action()
{
    short int input;

    cout << "1. Login\n2. Register" << endl;
    cin >> input;

    switch(input)
    {
        case 1:
        login_menu();
        break;

        case 2:
        register_menu();
        break;

        default:
        cout << "Type Again!" << endl;;
        what_action();
        break;
    }
}

void register_menu()
{
    string user, pw;
    int agree;
    
    cout << "Username: ";
    cin >> user;
    
    cout << "Password: ";
    cin >> pw;

    cout << "Have You Read our Agreement ? ( 1 = yes )";
    cin >> agree;

    switch(agree)
    {
        case 1:
        add_user(user, pw);
        break;

        default:
        cout << "Please Read our Agreement First !" << endl; 
        register_menu();
        break;
    }
}

void login_menu()
{
    string user, pw;
    
    cout << "Username: ";
    cin >> user;
    
    cout << "Password: ";
    cin >> pw;

    if(check_user(user, pw) == true)
        cout << "you have logged in succefully !" << endl;
    else
        cout << "Data is Wrong!" << endl;
}

void add_user(string username, string password)
{
    ofstream file;
    file.open(FILENAME, ios_base::app);

    file << username << "\n";
    file << password << "\n";

    file.close();
}

bool check_user(string username, string password)
{
    ifstream file;

    string line;
    bool what_to_return;

    file.open(FILENAME, ios_base::binary);

    if(file.is_open())
    {
        while(getline(file, line))
        {
            string usr, pw;

            usr = line;

            getline(file,line);

            pw = line;

            if(usr == username && password == pw)
            {
                what_to_return = true;
                break;
            }
            else
                what_to_return = false;
        }
    }

    return what_to_return;
}

Source: www.tutorialspoint.com

Add Comment

-5

c++ convert to assembly language

By Alive AlbatrossAlive Albatross on Mar 05, 2021
 
#include<iostream>
#include<fstream>
using namespace std;
 
struct mail
{
    char un[50];             // user name
    char pd[50];             // passsword
    void reg(int);
} obj[5];
 
void mail::reg(int k)
{
    int i=k;
    cout<<"\nEnter user name :: ";
    cin>>un;
    cout<<"\nEnter password :: ";
    cin>>pd;
 
    ofstream filout;
    filout.open("C:\\Users\\acer\\Documents\\registration.txt",ios::app|ios::binary);
    if(!filout)
    {
        cout<<"\nCannot open file\n";
    }
    else
    {
        cout<<"\n";
        filout.write((char *)&obj[i],sizeof(mail));
        filout.close();
    }
 
    cout<<"\n...........You are now registered.......... \n\n";
 
}   // end of sign up or register func
 
int main()
{
    int t;
    cout<<"\nEnter Registration Details for User 1 :: \n";
    obj[0].reg(0);
    cout<<"\nEnter Registration Details for User 2 :: \n";
    obj[1].reg(1);
    cout<<"\nEnter Registration Details for User 3 :: \n";
    obj[2].reg(2);
 
    mail obj2;
 
    ifstream filein;
    filein.open("C:\\Users\\acer\\Documents\\registration.txt",ios::in|ios::binary);
    if(!filein)
    {
        cout<<"\nUnable to open file to read\n";
    }
    else
    {
        cout<<"\nRegistered Details of All Users :: \n";
        filein.read((char *)&obj2,sizeof(obj2));
        while(filein)
        {
            cout<<"\nUsername :: "<<obj2.un<<"\nPasswword :: "<<obj2.pd<<"\n";
            filein.read((char *)&obj2,sizeof(obj2));
        }
            //filein.close();
    }
        return 0;
}
} 

Source: tutorialspoint.dev

Add Comment

0

c++ convert to assembly language

By Alive AlbatrossAlive Albatross on Mar 05, 2021
 
#include<iostream>
#include<fstream>
using namespace std;
 
struct mail
{
    char un[50];             // user name
    char pd[50];             // passsword
    void reg(int);
} obj[5];
 
void mail::reg(int k)
{
    int i=k;
    cout<<"\nEnter user name :: ";
    cin>>un;
    cout<<"\nEnter password :: ";
    cin>>pd;
 
    ofstream filout;
    filout.open("C:\\Users\\acer\\Documents\\registration.txt",ios::app|ios::binary);
    if(!filout)
    {
        cout<<"\nCannot open file\n";
    }
    else
    {
        cout<<"\n";
        filout.write((char *)&obj[i],sizeof(mail));
        filout.close();
    }
 
    cout<<"\n...........You are now registered.......... \n\n";
 
}   // end of sign up or register func
 
int main()
{
    int t;
    cout<<"\nEnter Registration Details for User 1 :: \n";
    obj[0].reg(0);
    cout<<"\nEnter Registration Details for User 2 :: \n";
    obj[1].reg(1);
    cout<<"\nEnter Registration Details for User 3 :: \n";
    obj[2].reg(2);
 
    mail obj2;
 
    ifstream filein;
    filein.open("C:\\Users\\acer\\Documents\\registration.txt",ios::in|ios::binary);
    if(!filein)
    {
        cout<<"\nUnable to open file to read\n";
    }
    else
    {
        cout<<"\nRegistered Details of All Users :: \n";
        filein.read((char *)&obj2,sizeof(obj2));
        while(filein)
        {
            cout<<"\nUsername :: "<<obj2.un<<"\nPasswword :: "<<obj2.pd<<"\n";
            filein.read((char *)&obj2,sizeof(obj2));
        }
            //filein.close();
    }
        return 0;
}

Source: tutorialspoint.dev

Add Comment

0

All those coders who are working on the C++ based application and are stuck on c++ to assembly can get a collection of related answers to their query. Programmers need to enter their query on c++ to assembly related to C++ code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about c++ to assembly for the programmers working on C++ code while coding their module. Coders are also allowed to rectify already present answers of c++ to assembly while working on the C++ language code. Developers can add up suggestions if they deem fit any other answer relating to "c++ to assembly". Visit this developer's friendly online web community, CodeProZone, and get your queries like c++ to assembly resolved professionally and stay updated to the latest C++ updates. 

C++ answers related to "c++ to assembly"

View All C++ queries

C++ queries related to "c++ to assembly"

Browse Other Code Languages

CodeProZone