fork download
  1. #include <iostream>
  2. #include <fstream>
  3. #include <iostream>
  4. using namespace std;
  5.  
  6.  
  7.  
  8. int main(){
  9. int i=0;
  10. char x[76];
  11. char c=' ';
  12. char Filename[81]= "/home/Damien/fileout.txt";
  13. system("powercfg -getactivescheme > /home/Damien/fileout.txt 2>&1");
  14. ifstream fin;//Create Fin from ifstream
  15. fin.open(Filename);//open the file.
  16. if (!fin) return 0;//if it doesn't open, return
  17. while(fin.get(c)){
  18. x[i] = c;
  19. i++;
  20. }
  21. x[i] = 0;
  22. cout <<x;
  23.  
  24. if (strcmp (x, "Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c (High performance)") ==0){
  25. system("powercfg -setactive 70fcbfa4-9fe8-4456-86ad-3d35e209a1af");
  26. }
  27. else{
  28. system("powercfg -setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c");
  29. }
  30. return 0;
  31. }
  32.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty