#include<iostream> #include<conio.h> #include<stdio.h> #include<stdlib.h> #include<string> #include<fstream> using namespace std; char keys[25]; int main() { int count=0; string data; char k[20]; ifstream my("keys.txt"); //if (myfile.is_open()) //{ while (! my.eof() ) { getline(my,data); k[count]=data; cout << data << endl; count++; } my.close(); //size=data.length(); //cout<<"Length of string is : "<<size<<endl; cout<<"The number of keys are :"<<count<<endl; for(int i=0;i<count;i++)> { k[i]=data[i]; cout<<k[i]; } /*for(int j=0;j!='\0';j++) { k[j]=data[j]; } for(int i=0;i!='\0';i++) { cout<<k[i]; cout<<endl; } //} //else cout << "Unable to open file"; for(int j=0;j<size;j++)> { keys[j]=data[j]; } */ system("pause"); return 0; }
#include<iostream> //#include<stdio.h> //#include<stdlib.h> #include<conio.h> using namespace std; int main() { FILE *k; int v; k=fopen("pre1.c","r"); while(v=getc( k )!=EOF) { putch(v); cout<<"Value is :"<<v<<endl; } fclose(k); system("pause"); return 0; }
#include<stdio.h> int main() { freopen("input.txt","r",stdin); //freopen("output.txt","w",stdout); int c,i=0; int array[100]; while((scanf("%d",&c))!=EOF) { array[i++]=c; } //getchar(); return 0; }
std::string myString = "99"; int value = atoi(myString.c_str());
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)