Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- #include <fstream>
- using namespace std;
- int main() {
- ifstream f("nigg1a.txt");
- if (!f) cout << "file not open\n"; else cout << "file open\n";
- char*str= new char;
- char*std= new char;
- int x,n,d;
- int c=0;
- while (!f.eof()) {f>>str; n=n+1;}
- cout<<"str=" << str<<endl;
- d=strlen(str);
- cout<< "d="<<d<<endl;
- for (x=0;x!=d;x++){
- if (isdigit(str[x])){std[x]=str[x];c=c+1;}
- }
- cout<<"digit is:";
- for (x=0;x!=c;x++){
- cout << std[x];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement