|
|
iQChange wrote: |
---|
Oh, it wil only close when file doesn't exists... |
char ext[length + 1];
|
|
|
|
char* str_b = const_cast<char*>(str_b_);
char * ext = new char[length + 1];
ext[length + 1] = '\0';
$ mv foo.py{,w} |
> How can I deal my project for Linux and Mac? distribute the source code |
> I've created some functions for less size (header functions that I don't need) http://linux.die.net/man/1/nm |
> and security (type to type, not type* to type[] and others) no idea what you're talking about |
bool str_is_equal
. Think: what is the default type when passing strings to a function? const char[]
. If I just use a char*, your compiler warn you: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] |
> char* str_b = const_cast<char*>(str_b_); ¿what for? |
> char * ext = new char[length + 1]; > ext[length + 1] = '\0'; out of bounds |
> Check if file exists http://www.cplusplus.com/forum/general/71333/#msg380507 |
> Enter anything to proceed (exit)... I consider that a bad UI |
:( |
by the way $ mv foo.py{,w} |
$ g++ foo.cpp -O2 -o Py2Pyw # cp Py2Pyw /usr/bin/ |
|
|
const char*
!> Think: what is the default type when passing strings to a function? const char[]. > If I just use a char*, your compiler warn you: int strcmp ( const char * str1, const char * str2 );[ size_t strlen ( const char * str ); ¡look, const char*! there was no need for you to create such functions. |