| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to retrieve char, from implmentation file to main.cpp
Hello,
When I derived a class, I can code as below in the implementation file : int option_parameters::get_option_type(const char * in_string) { // Member function for returning option_type parameters if (! strncmp (in_string, "payoff_type", 100)) { return payoff_type; } ...... Then, in my main, I can retirve the payoff_type by code : int payoff_type = this_option_params->get_option_type ("payoff_type"); It only works for int & double, But, I don't know how to extend this idea to other data type , such as char. I looked into the strncmp but still not know how to modify. Would anyone give me some hints so that I can retrieve the char in a similar fashion. Thank you very much!! |
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > How to retrieve char, from implmentation file to main.cpp |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|