| Цитата | 1) Как преобразовать Строку в double , в int и обратно?
|
| Цитата | Convert a string to double (atof and _wtof), integer (atoi, _atoi64, _wtoi and _wtoi64), or long integer (atol and _wtol).
double atof( const char *string ); double _wtof( const wchar_t *string ); int atoi( const char *string ); __int64 _atoi64( const char *string ); int _wtoi( const wchar_t *string ); __int64 _wtoi64( const wchar_t *string ); long atol( const char *string ); long _wtol( const wchar_t *string );
Convert strings to a double-precision value.
double strtod( const char *nptr, char **endptr ); double wcstod( const wchar_t *nptr, wchar_t **endptr );
Convert an integer to a string.
char *_itoa( int value, char *string, int radix ); char *_i64toa( __int64 value, char *string, int radix ); char * _ui64toa( unsigned _int64 value, char *string, int radix ); wchar_t * _itow( int value, wchar_t *string, int radix ); wchar_t * _i64tow( __int64 value, wchar_t *string, int radix ); wchar_t * _ui64tow( unsigned __int64 value, wchar_t *string, int radix );
Convert a long integer to a string.
char *_ltoa( long value, char *string, int radix ); wchar_t *_ltow( long value, wchar_t *string, int radix );
unsigned long to string
char *_ultoa( unsigned long value, char *string, int radix ); wchar_t *_ultow( unsigned long value, wchar_t *string, int radix );
Converts a double number to a string.
char *_ecvt( double value, int count, int *dec, int *sign ); Parameters value Number to be converted. count Number of digits stored. dec Stored decimal-point position. sign Sign of converted number.
Converts a floating-point number to a string.
char *_fcvt( double value, int count, int *dec, int *sign ); Parameters value Number to be converted. count Number of digits after decimal point. dec Pointer to stored decimal-point position. sign Pointer to stored sign indicator.
Converts a floating-point value to a string, which it stores in a buffer.
char *_gcvt( double value, int digits, char *buffer ); Parameters value Value to be converted. digits Number of significant digits stored. buffer Storage location for result. Return Value _gcvt returns a pointer to the string of digits. There is no error return.
|
| Цитата | 2) В C++ можно задать динамич. массив?
|
Да
| Код | int* arr = new int[size];
int* 2Darr = new int*[size1]; for ( int i=0; i<size2; i++) { 2Darr[i] = new int[size2]; }
....
|
Добавлено @ 22:52 Блин, ошибся, нельзя использовать имя 2Darr =) |