Skip to main content

14h
comment Ensuring an array of ints is actually null terminated
@Someprogrammerdude I can't change Bar, but otherwise you're right, std::vector would be most appropriate.
14h
comment Ensuring an array of ints is actually null terminated
@Red.Wave well, it's old code and Bar cannot be changed. But yes, otherwise you're right.
14h
comment Ensuring an array of ints is actually null terminated
@molbdnilo disregard my previous (now deleted) comment. The elements in the array are only non zero, that's the reason 0 is used as terminator (kind of like raw C strings).
14h
comment Ensuring an array of ints is actually null terminated
@JesperJuhl true, but unfortunately Bar only accepts raw int pointers and I cannot change this.
14h
comment Ensuring an array of ints is actually null terminated
@Jarod42 that's what I need, you can make this an answer and you'll have my upvote.
15h
asked Ensuring an array of ints is actually null terminated
17h
revised Fastest read and sum of integers in C
deleted 18 characters in body
1d
comment Fastest read and sum of integers in C
@DireNeedForSpeed in my comment I wasn't mentioning the gc function which is in deed called quite often.
1d
comment Fastest read and sum of integers in C
@DireNeedForSpeed maybe you would get one less call, but read and write are so much more complex, so the difference will most likely not be mesurable. And anyway, how often will readand write be called anyway?
1d
comment Fastest read and sum of integers in C
OT: don't use magic numbers such as 48 but rather '0'.
May
6
revised If statement with boolean causes function to stop working
deleted 4 characters in body
May
6
comment What is the difference between an enumeration constant and an enumerator?
The terms enumerator, enumeration constant and and enumerator list are explained in paragraph 6.7.2.2. Without reading this paragraph the terms are in deed very unclear IMO.
May
6
revised What is the difference between an enumeration constant and an enumerator?
added 1 character in body
May
6
revised What is the difference between an enumeration constant and an enumerator?
added 1 character in body; edited title
May
5
comment How to disable Excel instance merging?
The registry trick only works if you start a new instance of Excel by clicking on the Excel shortcut. If you create a new workbook with Ctrl+N, the new workbook is opened in the same instance and you get the WTF behaviour again.
Apr
30
comment behaviour of fprintf when 'ls' format specifier is used with precision set for printing string of wide characters
It simply prints those 2 characters. Rule of thumb: the null character ends the printing no matter what. Check this: godbolt.org/z/z1MrYcPsY
Apr
25
comment Why does my message box look different from those Windows 10 otherwise shows?
The correct way is to use a manifest that enables visual themes. Using ShellMessageBox is not the correct way.
Apr
25
comment Why is it a problem to call static inline function in an extern inline function?
Here is a [mcve]: godbolt.org/z/s1sMfG5T4. Maybe you should [edit] your question and get rid of the irrelevant stuff.
Apr
25
comment Why is it a problem to call static inline function in an extern inline function?
Does declaring static functions in a header file even make sense?
Apr
25
revised What is the character code of the debugger on Visual Studio?
edited tags
1 2 3 4 5