Jump to content

Weber01

Member
  • Posts

    17
  • Joined

  • Last visited

Awards

This user doesn't have any awards

Contact Methods

Profile Information

  • Gender
    Male

System

  • CPU
    i7 8700k
  • Motherboard
    Asrock Z370
  • RAM
    Cruscial Ballistic Sport LT 64Gb
  • GPU
    Zotac 1080 ti amp extreme
  • Case
    Cooler Master master case
  • Operating System
    Windows, MacOS, Manjaro

Weber01's Achievements

  1. I tried to put getline also in the first procedure but once you run the code typing "1" does not work either. As for the switch selection I can not put getline because it's an integer
  2. 2018-11-09 23-10-06.mp4
  3. I do not understand why using the getline method this is bypassed and the program proceeds going forward without inserting the input
  4. This is my code #include <iostream> #include <fstream> using namespace std; bool a = false; int selezione; string testo,nome; char ch; //create file void crea_file(){ ofstream myfile; cout<<"Inserisci il nome del file (con estensione): "; cin>>nome; myfile.open (nome); myfile.close(); system("clear"); } //write file void scrivi_file(){ ofstream myfile; myfile.open (nome, ios::in); cout<<"scrivi il contenuto del file! :\n"; getline (cin,testo); myfile<<testo; myfile.close(); system("clear"); } //read file void leggi_file(){ ifstream myfile; myfile.open (nome); system("clear"); cout<<"Il contenuto di "<<nome<<" è\n\n"; while (!myfile.eof()) { myfile.get(ch); cout<< ch; } cout<<"\n\n\n"; myfile.close(); } int main (){ do{ a==false; cout<<"Digita 1 per creare un file\n"; cout<<"Digita 2 per scrivere\n"; cout<<"Digita 3 per leggere il file\n"; cin>> selezione; system("clear"); switch (selezione) { case 1: crea_file(); break; case 2: scrivi_file(); break; case 3: leggi_file(); break; default: a=true; break; } }while (a!=true); cout<<"Arrivederci!"; } Thanks for your Answer
  5. Hi guys, I have a problem, in a nutshell I would like to create a program in C ++ that reads user input and puts it in a file. I managed to do everything except to write the file, that is, when the user inserts the text in the file is written only the word that comes before the space, how can I make it print all the text entered by the user?
  6. Thank you so much!
  7. Hi, recently At school we studied the function to read and write files on c ++, can you explain to me how it works? For example if I want to create a program that draws a menu made with a switch typing "1" creates a file, typing "2" allows you to write to and typing "3" allows you to read it how should I do? can I create multiple files with the same program? Thank you
  8. Thanks for the reply, as I said I know where to find the Roms but I do not know if they are compatible with the original GBA. Do you think they are compatible?
  9. hi guys, I recently bought the EZ-FLASH IV for my GBA. I managed to make it work quietly, but I do not know where I can find the games, I know where to find the various roms but I do not know if they are compatible with the original GBA. Can you help me? thank you
  10. I would like to have a graphical interface. This web service must function as if it were a database from which it must receive and send information
  11. The next time I meet him I have to bring him the project
×