Soluții

How to Change Your Instagram Username and Display Name

On Instagram, you can change your display name or username whenever you want, as often as you want. Follow the guide below to change your Instagram name and/or handle.

Your Instagram display name and username are two separate things. Your display name appears below your profile icon, and it doesn’t have to be unique. You can even add emojis or special characters to spice it up. Your Instagram handle, or username, on the other hand, appears at the top of your Instagram profile. This is your unique identifier. It can’t be longer than 30 characters, and special characters aren’t allowed here. You can only use letters, periods, numbers, or underscores.

[mai mult...]

How to read data from files with C++

  1. Include the fstream header file with using std::ifstream;
  2. Declare a variable of type ifstream
  3. Open the file
  4. Check for an open file error
  5. Read from the file
  6. After each read, check for end-of-file using the eof() member function.

Example:

#include <iostream>
using std::cerr;
using std::cout;
using std::endl;
#include <fstream>
using std::ifstream;
#include <cstdlib> // for exit function
// This program reads values from the file 'example.dat'
// and echoes them to the display until a negative value
// is read.
int main()
{
   ifstream indata; // indata is like cin
   int num; // variable for input value
indata.open("example.dat"); // opens the file
   if(!indata) { // file couldn't be opened
      cerr << "Error: file could not be opened" << endl;
      exit(1);
   }
indata >> num;
   while ( !indata.eof() ) { // keep reading until end-of-file
      cout << "The next number is " << num << endl;
      indata >> num; // sets EOF flag if no value found
   }
   indata.close();
   cout << "End-of-file reached.." << endl;
   return 0;
}
[mai mult...]