« first day (1422 days earlier)      last day (2434 days later) » 

10:24
Please take a moment to think about why you're even on SO answering this question in the first place. Is it to help the OP, or is it some kind of intellectual masturbation? If it is the former, please look at your comments and answer again and ask yourself whether it is helpful. Hint: it isn't. It would be fine to provide the information you did in addition to actually helping the OP and answering the question, but by itself, no, nobody will benefit from it. — hvd 53 secs ago
lol
10:42
@AnttiHaapala was funny the OP with the (signed int) with %x printed delete the question... %x expect an unsigned integer send a signed integer is undefined behavior
didn't have time to write my answer...
haha I get trouble with hvd yesterday and with a google inge xd
@Stargateur: You say that "there is only one C standard and it's C11", you also say you "never say C90 is not a standard". I am not sure of a reasonable way to reconcile these two claims. I am curious what you claim the C committee's definition of "standard" is... is there a citation you can provide that describes what the word "standard" means to the C committee? — Dietrich Epp 13 hours ago
11:01
C90 is not a standard. It is the first edition of the standard "ISO/IEC 9899". It was the standard until it was amended, after which it was the standard with the amendments. It has now been cancelled. You cannot usually even get documents for obsolete standard editions from the standard bodies. The current standard for C programming is ISO 9899:2011. — Antti Haapala 10 secs ago
my take :P
he gonna think we are helping each other to fight him XD, I hope he not.
@Stargateur if you're going to get your organization ISO 9001 certified this year, no one is going to assess your organization using ISO 9001:1987 and say you're ISO 9001 certified!
likewise no new compiler is a C compiler if it doesn't do 9899:2011
I allow compiler to take 1-2 years to do their implementation when new C standard is coming before remove them of my list of compiler ;).
MSVC starting to be very late haha, 30 years is a lot !
But I don't consider C99 to not be a standard at all like you. ;)
I'm more "moderate"
but obsolete standard is probably a good concept for C99
it is obsolete standard revision ;)
otherwise we'll have the
so classic ^^, that what I tried to explain, "Like there is only one python standard and it's python 3, python 2 is just a standard but not "python standard". This is a importante concept to avoid this kind of thing like "I don't care I will stay forever to C89" ;)"
The only good reason to create a new standard is when no existing standard fit your need
11:15
I tried to improve my question. Is it ok now? And if not, where should I ask? I tried Stack Overflow because I found similar questions here … — MalteM 2 mins ago
Is it still a question "asking us to recommend or find a book, tool, software library, tutorial or other off-site resource"? Yes! Then it is still "off-topic for Stack Overflow". — Antti Haapala 23 secs ago
And do note that if not, then a question that asks to do a thing in any of 3 very distinct programming languages would be too broad. — Antti Haapala 41 secs ago
yeah that trigger me
specially the "C/C++"
@Stargateur thanks for diplomacy :D
11:57
@AnttiHaapala This user is whining more that he/her work.
raaaaaaaaaaaaaaaaaaaaaaaaaage quit
at the end he/her say "you downvote my question too, no ?"
didn't have time to answer no I upvote because you got too many downvote and too give you credit by trying to fix it
12:25
You say "Now I want to compile ffmpeg to a static library." for me that mean "I don't successfully build static library" them you say, "But as you see, I can only get libavutil and etc lib." so you actually have successfully compile some ! Sorry but I don't read generated makefile it's useless. Plus, you never list what lib you want to be build with ffmpeg or mention that you want additional lib in your question, it's explicit in the doc that if you want specific lib you mush enable them, trac.ffmpeg.org/wiki/CompilationGuide/macOS#Additionallibrar‌​ies. Read How to Ask ! — Stargateur 11 secs ago
diplomacy has gone away
12:38
"I want ffmpeg.a file instead of ffmpeg binary file."
I don't know what I could answer
like, do you know what is a binary ?
or do you know that it's a library
or do you know that technically all is a binary
what is a static binary for you ?
or do you even do something else that android in you life ?
so many question
I used to bikeshed terminology, but then I realized it doesn't matter
what matters is that if I'm able to guess what the other person means
I try to explain him right now
like "I'm going to assume that by "binary" you mean "binary executable file" - correct me if I guessed wrong"
yeah, I'm going on something like that
now I think we got a xy problem
13:37
Did anyone tried to read a .bmp image into an unsigned char* . I tried now and I get a lot of 69696969 and the Read failed lol
@O.Rares did it on my first year at school, github.com/Stargateur/wolf3d/blob/master/src/my_bmp.c, ugly code, only work for one specific type of bmp, github.com/Stargateur/wolf3d/blob/master/header/my_bmp.h
mine is this one pastebin.com/0y2ayrJ9 ,I will try yours,I have also a python script that does this conversion into hex format but it generates 2 times more values for some reason and it works
 
3 hours later…
17:02
There is only a couple lines where there is not something wrong in the code. They're #include <stdio.h>, the lines with } and the return 0;. — Antti Haapala 23 secs ago
17:13
well return 0 is not necessary...
yes
but there is not much wrong about it
including <stdbool.h> when it is not used, is
Hey all
ah more C++/C differences
Need some input
17:18
null pointer constant is...

an integral constant expression rvalue of integer type that evaluates to zero
(until C++11)

an integer literal with value zero, or a prvalue of type std::nullptr_t
@JohnDoe #include <stdio.h> :P
yep, that why c++ function should use NULL when dealing with C API
@JohnDoe fprintf(stderr, "Please input your question");
I need to make a n-ary tree where n is dynamically defined, so I made a structure that contains a "struct node** children" since I want to allocate n pointers
But I get crashes and a lot of problems with malloc, setting the pointers to null, and then trying to malloc specific addresses
I don't think that's necessary. nullptr converts to pointers just fine, and in variadic functions, you have to cast to the specific pointer type the function expects anyway, regardless if you use NULL or nullptr as your preferred null pointer constant.
17:25
I'm not sure if my logic is correct. But is this how I should go about it:
1. When a node is created, new_node->children = malloc(n*sizeof(node*))
2. for(i = 0; i < n; i++) new_node->children[i] = NULL

and then when I want to add a new element

3. new_node->children[i] = malloc(sizeof(node)) ?
don't do malloc(n*sizeof(node*))
you're repeating the type name with a risk of getting it wrong
but yes, otherwise, it is.
What do you mean?
new_node->children = malloc(n * sizeof(*new_node->children));
Hmm, I'm trying to wrap my head around that
17:28
@milleniumbug yeah in practice, a case where NULL is not compatible with nullptr must be close to impossible
as sizeof is not a function, new_node->children = malloc(n * sizeof *new_node->children); the fun is you can write it new_node->children = malloc(sizeof new_node->children[n]);
the expression sizeof is operating on got too complicated so I parenthesized it
I just don't get how it is semantically different from mallocing for a sizeof node*
it's not a DRY violation
Hmm, I'll try writing it that way in a bit
@Stargateur not that it would help there as you'll just get sizeof pointer
unlike sizeof(node *[n])
17:43
oh indeed I mess up
sizeof(char [n]) will work
I'm sure there was something cooler that this...
oh char (*buf)[n] = malloc(sizeof *buf);
whatever I'm being off topic ^^
@JohnDoe what ever if you want help do a mcve
 
1 hour later…
18:57
Thanks guys, I see I'd made other mistakes
19:36
0
Q: Send ethernet raw packets on localhost in kernel module

Ema EspI am implementing two kernel modules sending custom ethernet packet. It works when the two modules are in two different machines, but it does not when the destination address is the same as the interface used. This is my sending function, I create a packet which is something like this: |MAC_ADD...

read the tittle => I don't want => read the end "Thanks in advance." => "Bye/gl in advance"
 
2 hours later…
21:28
What's going on?
Been playing around with Acme today.
Was able to implement a tool I wanted within an hour, which would have taken me a lot longer to do in VSCode.
Which is my current editor.
So essentially, I just wanted a quick way to generate a comment banner with a title (centered). To do that in VSCode, I'd have to write a typescript program or javascript[?] one to do it.
You'd also have to use the VSCode API. I thought it was a bit annoying to have to do so after messing around for an hour looking at the docs last month I just shelved it until later.
This weekend I was looking again at Russ Cox's demo of Acme, and decided I'd just install it using plan9ports.
Since Acme allows you to execute just about any text in it, all I did was write a C program that reads in a line, and outputs a comment block with the line centered. Pretty simple.
Got a recording here. If you want to see the tour, I think this is the main page for it. But a lot of the related pages on swtch.com are down. :/
Kind of trivial, but it made me really happy for some reason.

« first day (1422 days earlier)      last day (2434 days later) »