i want to add a prompt at the start of my program which ask a user to enter its password
wat will be its syntax it is confusing me alot
i have written this code but its gving me a problem
No, it doesn't. This line: if(pass==num) doesn't do what you want: it checks if the memory address of pass is equal to that of of num. To check equality between the strings, use this: if ( strcmp( num, pass ) == 0 ) http://www.cplusplus.com/reference/cstring/strcmp/
as pass and num are pointers, if (pass==num) checks if they both point to the same memory location - so it doesn't actually tell you anything about the strings involved - not even the first element.
by the way, i'd at least suggest encrypting your password file - otherwise it is edittable to all and sundry.