We have been working very hard since 2009 to facilitate in learning Read More. We can't keep up without your support. Donate.

Asalam o ALikum!

yrrrrrr agar kisi ny first lecture lia tu us ma jo refactor kia program ko us ma error a raha koi help kr dy. code nichy dy raha hon es ma error dy raha k [Error] 'f' was not declared in this scope:

ya kon sy scope ka error ha koi help kr dy plzzzz

#include <iostream>
#include <fstream>
#include<conio.h>
int onkeypress()
{
char b = std::cin.get();
std::cout b std::endl;
return b == 'x';
}
int onfilechanged()
{
char a = f.get();
std::cout a std::endl;
return a == 'x';
}
int main()
{
char a = '-', b;
do {
if (kbhit()) {
if (onkeypress())
return 0;
}
std::ifstream f("test.txt", std::ifstream::in);
if (f.good() && a != f.peek()) {
if (onfilechanged())
return 0;
}
f.close();
} while (true);
return 0;
}

Views: 49

Looking For Something? Search Below

Latest Activity

+!!★彡 "Mannat"彡★✓ liked Ammara Sabir's video
5 hours ago
silent eyes posted a status
"Education is not a name of any degree or certificate but education is a name of our attitude language , behavior with others in real life."
5 hours ago
+!!★彡 "Mannat"彡★✓ liked + !! Ήලᵯᵯℹ Ⲥⱨ !! +!!'s discussion !!!!!!! TRUE FRNDS NEVER CHANGE
5 hours ago
+!!★彡 "Mannat"彡★✓ liked +⚔️ FURQAN ⚔️'s discussion just for sanam
5 hours ago
+!!★彡 "Mannat"彡★✓ liked + рэяғэст ѕмөкэя ZɘɭƖSʜ's discussion GALI KYA H?? URDU ADAB SE SHAGHAF RAKHNY WALY ZROOR PARHAIN++++
5 hours ago
+ рэяғэст ѕмөкэя ZɘɭƖSʜ liked + !! Ήලᵯᵯℹ Ⲥⱨ !! +!!'s discussion !!!!!!! TRUE FRNDS NEVER CHANGE
5 hours ago
mahumm ch updated their profile
5 hours ago
Profile IconWaqas Asif, Muhammad Tahir, Zubair Akbar and 9 more joined Virtual University of Pakistan
6 hours ago

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service