dump c++ptr value ] custom format

https://github.com/tiger40490/repo1/blob/cpp1/cpp1/printPtrFormatted.cpp

Advertisements

side-by-side #tested win7,10

Areo Snap (https://www.howtogeek.com/181681/4-hidden-window-management-tricks-on-the-windows-desktop/) worked on my Win10:

  • hold winKey and hit 4 arrow keys
  • I think this app treats the desktop as 4 quadrants. Each window can snap to
    • any one quadrant or
    • a full column
    • but not a full row
  • You can even drag the boundary between 2 tiled windows 🙂

c++split string on custom delimiter char #practice every2months

For a longer delimiter, you may need string.find()

ifstream f1(fileName.c_str());
string line;
while(getline(f1, line)){
  for(int i=1; ;++i){
        int pos = line.find_first_of("\t");
        string token = line.substr(0,pos);
        cerr<<i<<" : " <<token<<endl;
        if (line == token) break; //there's no more tab in the line
        line = line.substr(pos + 1);
  }
}

///// a simpler method:
istringstream lineStream("denmark sweden   india us"); //consecutive spaces are Not treated as one
string outputToken;
int main(){
  while (
    getline(lineStream, outputToken, ' ')) // <-- the only thing to remember
        cout << outputToken << endl;
}