passing strings
-
well i knew this very well that without reading books..i can't...but if its some sort of urgency.. you hav to take someone's help ...is that wrong?...please forget all those past mistakes...and lets be friends.;)
dona jain wrote:
well i knew this very well that without reading books
well, don't get me wrong. i'm not paid to answer on this board. all i do is because i want to and i love it. but i'm still thinking you have some lack of knowledge that you should fix fastly. calling a finction is part of the basics of the C/C++ (and any programming - in general...) languages. if you can't figure out how to call one, then you should start from the beginning.
dona jain wrote:
but if its some sort of urgency
i'm not a doctor ;P
dona jain wrote:
you hav to take someone's help
i'm not obliged to do so, and know that i do my best anyway. but sometimes, i really don't understand the question, so how to help then ? and if i was obliged to help, then the one who's asking should be obliged to ask with all the useful informations we must have to answer well in a one step. Is that Wrong ?
dona jain wrote:
please forget all those past mistakes
i hope you understood me and will make efforts in the future. for my part, i have nothing against you. just against your questions ;) Sincerely... :rose:
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
-
- i don't understand your question 2) i don't understand your code either 3) no need to say "i need help" (if you ask something, it's obviously because you need help), nor "please answer as early as possible" (people do reply when then know the answer... if no one reply you, it's because no one knows, or no one got your question). so, i ask you the question. What is it you're trying to achieve, and what have you already tried ? what do you mean by "these three strings can be utilised in main file only" ??
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
toxcct wrote:
if you ask something, it's obviously because you need help
Simple, yet powerful. :)
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Hi all! i need help.. i m calling fileRead function which reads the file and put some values in three strings cName1 ,cSvnPath1 ,cPassword1...now my question is ...that how should i call this function in main file so that these three strings can be utilised in main file only...??? please answer as early as possible. void FileOperation::fileRead(char cName[100] , char cSvnPath[100] , char cPass[100]) { char cName1[100]; char cSvnPath1[100]; char cPassword1[100]; FILE *fp; fp = fopen("config.txt","r"); fgets(cName1 , 100, fp); fgets(cSvnPath1 ,100 , fp); fgets(cPassword1 ,1 ,fp); fclose(fp); }
Since you're obviously using C++ you should use it correctly. Don't pass crap like char cName[100] as arguments in functions or as variables. Use the STL's std::string class for representing a string. Thus you would rewrite the above as void FileOperation::fileRead( const std::string& cName, const std::string& cSvnPath, const std::string& cPass ) second problem - you have variables defined within the local scope of your function with the same name as the arguments you've defined in your function. That could be problematic. You should go out and get a good book on C++ first and get comfortable with the basics.
¡El diablo está en mis pantalones! ¡Mire, mire! Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! VCF Blog