C++ to txt file update
-
දන්න කෙනෙක් කියන්න c++ වලින් කොහොමද txt file එකක තියන data update අරන්න් code එක ලියන්නේ කියලා
Eg : username and password txt එක්ක තිබොත් c++ හරහා password එක update කරන්න
-
-
@Malith not the answer i was hoping
-
.txt use karanna epa .dat use karnana oyata lesiyen karnana puluwan oya wade.
-
me thiyenne .txt eken use karana widiya.
#include <iostream> #include <fstream> #include <conio.h> #include <string> using namespace std; class User { public: string username; string password; void userRegister() { ofstream usersFile ("userData.txt"); if ( !usersFile.is_open()) { usersFile.open("userData.txt"); } usersFile << username << " " << password << endl; usersFile.close(); } }; int main() { User user1; cout << "Welcome!\n-------------------------------\n\nPlease register.\nEnter a new username:\n"; cin >> user1.username; cout << "\nPlease enter a new password:\n"; cin >> user1.password; user1.userRegister(); getch(); }
-
@ciaompe machan assigment ekata, txt file ekin thibanm thama hari,
-
@ChrisSachintha
Oya udin dala thiyenne machan code eka -
guys mata one wade una, thanks for every ones's help eth ogola hamoma duna link wala thibe for loop ekak athule code karala, ee nisa api loop eka run wene dene ganata thami run une, eka aula thami hithana login,txt eka records 100 thiyanwa eth api loop ekata dune 10 bn eka wada nane, ow ow dan ogola kiyai 100 loop ekata dunam harine kiyala, na eka waradi mokda mage program eka thiyanwa aluthin record txt fielata add karana ethaktoa 100 dala bane, anway thanks man code eka manma hadagatha, ogolatantath awasha wei kiyala hithuna nisa denam code ekata
https://helageek.blogspot.com/2019/08/c-txt-file-data-update-code.html