I have done with the basic programs of C++. But in this programming language I am getting error while doing one program. I am not able to find out an exact error in program. The following is the program :
Code:
char * stringTochar_array ( System: : String ^ s )
{
char * s = new char [ s- > Length ];
int i = 0 ;
while (i <s-> Length )
{
s [i ] = s [i ] ;
i + + ;
}
l [ i ] = '\ 0 ';
court < <" the stringtochar = "< < s < <endl ;
return l;
}
calling this function is :
Code:
char_string hp
while ( line ! = nullptr & & strcmp ( ch.stringTochar_array ( line) , line ) ! = 0 )
{
line = sr- > ReadLine ( ) ;
}
line = sr- > ReadLine ( );
( char_string is the name of the class that contains the " stringTochar_array ", the call is made from another class )
Hoping that someone will help me soon.
Bookmarks