sepp2k's Profile User Rating: *****

Reputation: 2297 Grandmaster
Group:
Mentors
Active Posts:
3,568 (2.01 per day)
Joined:
21-June 11
Profile Views:
61,285
Last Active:
User is offline Private
Currently:
Offline

Previous Fields

Country:
DE
OS Preference:
Linux
Favorite Browser:
Who Cares
Favorite Processor:
Who Cares
Favorite Gaming Platform:
Who Cares
Your Car:
Who Cares
Dream Kudos:
0
Expert In:
C/C++, Functional Programming, Java, Python, Computer Science
Icon   sepp2k has not set their status

Posts I've Made

  1. In Topic: Difference between 0 and const int 0?

    Posted 2 May 2016

    View Postjimblumberg, on 02 May 2016 - 02:03 PM, said:

    Because to change how NULL works would break C compatibility.


    C allows any expression of type int to be implicitly converted to pointer types. C++ only allows the literal 0. So they already broke compatibility and allowing more conversion would actually break compatibility less.

    PS: I wouldn't agree 100% with the statement that NULL doesn't have a type. Sure, macros don't have types as such, but expressions do and the macro NULL expands to the expression 0, which has type int.
  2. In Topic: Difference between 0 and const int 0?

    Posted 2 May 2016

    The standard explicitly allows the integer literal 0 to be implicitly converted to a pointer type. It does not allow other integer literals (like 1 or 42), nor does it allow arbitrary integer expressions.

    One could argue that they could have allowed constant expressions with the value 0, as those are more or less equivalent to the literal 0 anyway, but they didn't.
  3. In Topic: Create folder in windows directory for each user

    Posted 1 May 2016

    View PostDK3250, on 01 May 2016 - 03:31 PM, said:

    I have experienced the whitespace problem in file names on Raspberry Pi


    Were you using system by any chance? system takes a single string, which is given to the shell, which uses spaces to separate the arguments. So when using system, you need to escape any spaces or other special arguments in your command string, which is why it's preferred to use subprocess.call, which takes multiple arguments and doesn't have this problem. So you'd use subprocess.call("myapp", "file name 1", "file name 2") instead of having to do system("myapp file\\ name\\ 1 file\\ name\\ 2") or system("myapp \"file name 1\" \"file name 2\"").

    When using file- and directory-handling functions like mkdir there will never be problems with spaces on any platform.
  4. In Topic: Create folder in windows directory for each user

    Posted 1 May 2016

    View PostDK3250, on 30 April 2016 - 07:44 PM, said:

    The whirespace in 'Program Files' makes problems.


    Python is perfectly capable of handling paths with spaces in them. The problem is that you can only write to system directories (like "Program Files") when your code is run with admin rights.
  5. In Topic: python error invalid syntax and parentheses

    Posted 29 Apr 2016

    View Postandrewsw, on 28 April 2016 - 10:02 PM, said:

    That cannot be your real code, the indenting is all over the place.


    I'd wager that that is the real code and the indentation is all over the place because the missing parentheses made the editor further indent each, thinking each following line is part of the previous line's argument list.