[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 338
Thread images: 35

File: Edsger_Wybe_Dijkstra.jpg (846KB, 1200x1600px) Image search: [Google]
Edsger_Wybe_Dijkstra.jpg
846KB, 1200x1600px
What are you working on, /g/?

Old thread: >>61932358
>>
I'm attempting insertion sort without copying psuedocode, what am I doing wrong?

void insertion_sort(int *arr, int len)
{
int i, j;
for (i = 1; i < len; i++)
{
j = i;
while (--j)
{
if (arr[j] > arr[i])
{
int tmp = arr[i];
memmove(&arr[j + 1], &arr[j], i - j);
arr[j] = tmp;
break;
}
}
}
}
>>
Porting dwm to wayland.
>>
>>61939311
iirc dwm is a single 2k loc file
>>
File: dijkstra.png (44KB, 643x220px) Image search: [Google]
dijkstra.png
44KB, 643x220px
Way too early edition
>>
>>61939306
Replace that while with a for.
Create a swap function.
Don't use fucking memmove.
Use RAII, i.e. declare variables where they're used, unless you're writing C89.
>>
>>61939336
mine will have even less code since I'll be using libweston. it's the equivalent of libxcb or libx11 that dwm uses except it's lighter.
>>
>>61939340
I wish I was an accompilshed science fella
that way I could be an edgelord like nigguh Edsger
>>
Is there an easy way to simulate manual reset events under linux?

I have a circular buffer implementation that I wrote for windows and it uses SetEvent and ResetEvent to make the producer and consumer threads block when the buffer is full or empty.
How would I port this to linux without just polling?
>>
>>61939273
Is it weird that I find Dijsktra kinda hot?
>>
>>61939416
He isn't exactly a trap
>>
>>61939416
>>61939429
(therefore you are gay)
>>
>>61939345
>use RAII
There's no opportunity to use RAII at all here. He can't construct an object lifetime for the incoming array. That'd be madness.
>>
>>61939444
But I'm a girl..
>>
Can any rust fags recommend me a book?
>>
>>61939495
Tons of young girls like older not obese men for whatever reason. And yes it's weird and you should be ashamed.
>>
>>61939495
i totally believe you are a girl(boy)
>>
File: 1499806181420.gif (509KB, 440x330px) Image search: [Google]
1499806181420.gif
509KB, 440x330px
>tfw finished remaking my shit algorithm
>it's now much less shit
is there a better feeling lads?
>>
>>61939555
>Hurr Durr girl devs don't exist.
Retard.
>>
>>61939614
now make the code more concise and the comments more verbose

>>61939495
[citation needed]
>>
>>61939654
>now make the code more concise and the comments more verbose
on it
this mess is spread amoungst 3 different functions and makes no sense whatsoever
>>
>>61939637
prove it then.

pro tip: you can't.
>>
>>61940025
nice blogpost how can i subscribe
>>
File: 15026422252132.png (292KB, 1140x813px) Image search: [Google]
15026422252132.png
292KB, 1140x813px
>>61939495
Don't forget these
>>
is he just hoping that the uninitialized data section he's reserved for the string will have the input terminate with a 0, or does fgets append a 0 to the end of the user's input? if the former, what if the user puts in exactly the maximum number of characters to fit in the section?
https://pastebin.com/2RLefem8
>>
>>61939495
Post penis then or no one will believe you
>>
I'm reading book on C before my semester starts.
2 chapters in, did bunch of programming exercises from that book using Pelles C and now at the end of the 2nd chapter they decided to talk about common errors?
Seems kind of dumb since I encounters almost every error they're describing during those exercises.
But the other thing is that author says that he has a compiler that tries to fix syntax errors automatically. Wouldn't that be a bad thing for students to have auto correct on?
>>
>>61940498
>he has a compiler that tries to fix syntax errors automatically
Why would anyone want that?
>>
>>61940568
>programming for at least 5 years
>still coming to /dpt/
That's like winning special olympics
>>
>>61940568
I am glad my self confidence isnt bad enough to come to threads to compare myself to others to feel better.
>>
File: 979829185795752325.jpg (12KB, 232x271px) Image search: [Google]
979829185795752325.jpg
12KB, 232x271px
>>61940672
This desu senpai baka
The guy can't even banter without making a fool of himself.
>>
File: google git contributions.png (199KB, 1024x768px) Image search: [Google]
google git contributions.png
199KB, 1024x768px
>>61939637
they are rare in the wild, something akin to a galapagos turtle. they only appear to breed and then they disappear afterwards
>>
If I am doing this:
  card test = new card{.rank = ranks[Rank::King], .suits = ranks[Suit::Heart]};
in the main function, do I have to delete test? test is a struct.

#include <iostream>
using namespace std;

enum class Rank {
Two,
Three,
Four,
Five,
Six,
Seven,
Eight,
Nine,
Ten,
Jack,
Ace,
Queen,
King,
count
};

enum class Suit { Club, Diamond, Heart, Spade, count };

int ranks[Rank::count] = {Rank::Two, Rank::Three, Rank::Four, Rank::Five,
Rank::Six, Rank::Seven, Rank::Eight, Rank::Nine,
Rank::Ten, Rank::Jack, Rank::Ace, Rank::Queen,
Rank::King};
int suits[Suit::count] = {Suit::Club, Suit::Diamond, Suit::Heart, Suit::Spade};

struct card {
int rank;
int suit;
};

void print_card(card this_card) {
// unimplemented
}

int main() {
card test = new card{.rank = ranks[Rank::King], .suits = ranks[Suit::Heart]};
return 0;
}
>>
>>61939637

Oh, there's plenty of female devs these days... but female 4channers? Much less likely.
>>
is it true OSGTP is a Haskell shill now?
>>
>>61940919
Go back to plebbit, fucking faggot
>>
>>61940899
4chan's majority userbase is school going girls actually
>>
>>61940899
Have you seen /u/ or /cgl/?
>>
>>61940824
why create enum classes if you are going to declare the arrays like that, use a loop bro
>>
>>61940963

Exceptions to the rule. /soc/ also has a few girls, but boards like /g/? Pretty much just men and traps.
>>
>>61940998
>and
>>
Just started learning Java coming from C and IntelliJ is comfy as fuck
>>
>>61940797
sauce on pic?
>>
>>61939429
I'm sure he has a nice firm ass and giggles when you grab it though.
>>
>>61940963
>/u/
For some reason I'm convinced that most of those posters are men whose lesbian fantasies have deluded them into posting as "women".
>>
File: 1502565217110.png (303KB, 800x485px) Image search: [Google]
1502565217110.png
303KB, 800x485px
What is the best programming language if both my development time and my hardware resources are limited?
>>
>>61940998
wanna port posix to sel4 on aarch64 together?
>>
File: 150204048302.jpg (29KB, 600x600px) Image search: [Google]
150204048302.jpg
29KB, 600x600px
What's your excuse for not using Go?
>super comfy to program in
>strong concurrency
>expressive like a scripting language, fast like a compiled one
Literally no reason to not use Go.
>>
>>61941121
Prolog
>>
>>61941121
haskell
>>
>>61941121
kill yourself
>>
>What data types would you use to represent the following items: number of
children at school, a letter grade on an exam, the average number of school
days a child is absent each year?
I answered int, char, int.
Solutions says. int, char, double.

Who is right here?
>>
>>61941145
Go is for literal brainlets, it's been well established. Furthermore it's a mediocre language, only alive because of google pushing it, Now fuck off
>>
>>61941145
>retarded vermin: the language
I'll pass
>>
>>61941169
Don't post your homework here.
>>
>>61941130

I'm going to be honest... as fun as that might sound, I'm starting a PhD program in 5 days, and my advisor has recommended that if I want to become a professor (which I already told him), that I should publish a paper every semester. I'm going to be very, VERY busy with research.
>>
>>61941169
Nobody, how you choose to represent data is up to you.
>>
>>61941169
>average
double
>>
>>61941198
I mean double isn't wrong in that case but just because it's average doesn't mean you have to use double.
>average amount of students in school at any given time
>75.4
Not aesthetic
>>
>>61941169
int, float, float
>>
>>61941145
Lolol no generics
>>
>>61941255
even if it had you wouldn't use it

lmao
>>
File: 1501743893143.jpg (35KB, 400x400px) Image search: [Google]
1501743893143.jpg
35KB, 400x400px
>>61941145
Using go is like a statement. A declaration that says "I'm an idiot"
>>
Just tried the Jackson JSON library for the first time. Recursive object (de)serialization is refreshingly concise and flexible.
https://github.com/FasterXML/jackson
>>
>>61941121
Nim... assuming it's not a large project
>>
>>61941268
why?
>>
>>61941286
Go is a disservice to intelligent programmers. It's an insult to human brain
>>
>>61941296
not an argument.

try again, kid.
>>
>>61941145
The fact that it has less support of generics than C89 is pretty embarrassing
>Let's take the control away from the devs
>Also let's take the abstraction away too
>lul u don't need them
>"Our language is made for people that don't understand brilliant languages"
Go is the true cuck language
>>
>>61941263

And what are we supposed to do, create our own vector type for every type parameter we'd want?
>>
>>61941309
dumb brainlet
>>
>>61941169
>Go
>Expressive
Damn, google shills
>>
>>61941263
Lolol fgt who doesn't meta program detected
>>
>>61941121
C#, seriously
>>
>>61941379
0/10
>>
>>61941189
its ok ruby senpai, i'll wait for you <3
>>
>>61941286
>>61941309
Memes aside, Go is basically the new Java. It eschews a lot of important modern concepts like generic programming in order to make it easy to use for the idiot code monkeys that Google usually hires. The end result is a potential increase in code complexity instead of a decrease.
>>
>>61941381
Not an argument.
>>
>>61941379
You mean python, right? It's lighter than C#
>>
>>61941394
>hardware resource limited
>lmao let's shill him our rebranded java that spawns a 300 Mb GC before even doing anything xd
>>
>>61941395
.NET Core is objectively superior to Python in multiple metrics.
>>
>>61941410
>python still lighter than botNET core
>>
>>61941406
>lmao let's shill him our rebranded java that spawns a 300 Mb GC before even doing anything xd
I work with C# and this is true, sometimes the GC doesn't work as efficiently as it should. It is still a pretty easy and quick language to develop to though.
>>
>>61941410
You can make that argument when Microsoft relinquishes their software patents.
>>
>>61941393
In Java's defense, it was originally created a long time ago, and they've tried to keep it backward compatible.

Go has no such excuses.
>>
>>61941145
>expressive
i dont think you know what that means
>>
>>61941146
>>61941150
>>61941283
>>61941379

Thanks all, will consider (except >>61941160
).
>>
>>61941499

Why would they need to relinquish their patents? They've already given you free license to use their product however the hell you want, and to modify it as you please, so long as you don't try and claim a patent over their shit (Apache 2 License)
>>
>write any program more complicated than a simple exercise
>main class ends up being >1000 lines
What can I do to stop this from happening?
If I try to split the main class into smaller classes then I run into the issue that methods from the smaller classes all need to use certain functions.
Then I run into the issue of having to make a header file full of static functions to include in all those classes and it seems kinda stupid.
>>
>>61941622

Apache 2 has a patent grant clause as well so... they already kind of have relinquished their patents?
>>
>>61941749
Just making everything static famlam. Objects are for losers.
>>
>>61941761

Guess so. .NET Core is sort of a mix between MIT on some parts and Apache 2 on other parts. Either way, it's all GPLv3 compatible.
>>
>>61941622
https://www.fsf.org/news/2009-07-mscp-mono
>guys we super duper promise not to sue you for technically violating our intellectual property rights, pinky swear

Nah. No one's that stupid. There's a reason Mono hasn't even taken off with official backing.

There's probably no difference if you only develop for Microsoft platforms though.
>>
>>61941749
>use OOP
>code is ugly and overengineered

really makes you think
>>
>>61941785
I'm kind've getting to the point where I don't like even using enums because it's a huge pain in the ass to have static casts riddled everywhere throughout the code.
>>
>>61941824

They legally can't sue you for it now though. In releasing .NET Core under a permissive license, and buying up Mono and continuing to release it under a permissive license, they have revoked their right to sue for patent infringement for using or modifying those products. Your article from the FSF is out of date because all of these products are in Microsoft's hands. You can't just give someone something and then sue them for using it under the terms that YOU agreed upon.
>>
>>61941749
You make it sound like a Java problem and then go on about header files. What exactly is your problem? "the smaller classes all need to use certain functions" doesn't explain shit.
>>
>>61940448
fgets writes a string, so it is always null terminated
It will only read up to the storage size minus 1 byte for the null terminator, so the last character will still be in stdin if that's where you're reading from
>>
>>61942023
>You make it sound like a Java problem
literally wat
>the smaller classes all need to use certain functions" doesn't explain shit.
How doesn't it?
>>
>>61942023
>You make it sound like a Java problem and then go on about header files.
kek at first I thought he was talking about Java or C# too
>>
Where do you get your books from /dpt/? If you know what I mean
>>
>>61942184
i do not know what you mean, please elaborate???
>>
>>61942184

I pay for them you commie.
>>
>>61942201
Books are communism themselves, there's no denying this
>>
>>61942211
not in my book
>>
>>61942184
>books
>not googling every single detail of every language
>>
>>61942184
literally book_name.pdf in your search engine of choice.
>>
>>61942214
Your books is trash
>>
File: 94522245.jpg (11KB, 328x277px) Image search: [Google]
94522245.jpg
11KB, 328x277px
>>61942217
>not just downloading the documentation and learning from that
>>
>>61942214
book is inherently communism
>>
>>61942271

Show your working..
>>
>>61942307
No I won't. I'm not a commi
>>
File: 2014_was_20_years_ago.jpg (60KB, 550x366px) Image search: [Google]
2014_was_20_years_ago.jpg
60KB, 550x366px
>>61941897
James how do I become a good programmer. I try to learn Go but it is too hard. ;_;
>>
>>61942334

Okay, this is twice that you have called me James. Who the hell is this person, and why do you have me mixed up with him?

Also, why the hell are you trying to learn Go?
>>
>>61942373
Brad?
>>
File: sad_pepe_at_the_computer.png (37KB, 1127x685px) Image search: [Google]
sad_pepe_at_the_computer.png
37KB, 1127x685px
>>61942373
>Who the hell is this person, and why do you have me mixed up with him?
I dunno, you just seem like a James to me.
>why the hell are you trying to learn Go?
Because Go is supposed to be super comfy ;_;
>>
>>61941897
And if you want to make your own C# implementation for whatever reason, you're still fucked. Microsoft realized it can't kill free software in the same hamfisted manner it killed its proprietary competitors, so it's trying to reign it in by abusing it like it does its own paying customers.

Not that I care of course, since the FOSS community doesn't want it anyway, like I said before. Go respects your rights if you want to be treated like an idiot by your computer. :^)
>>
>>61942386
>Go
>Comfy
You are misguided
>>
>>61942386
>comfy
>>>/v/
>>
>>61942386
You were lied to mr fin.
Give Nim a shot, its pretty brainlet friendly.
>>
>>61942386

Well you shouldn't go around calling people random names. If you will look in the name field, you will see I am called Ruby. If you want to call me Anon just like everyone else, that is fine too. But go making up new names. That's almost as bad as people calling me a girl.

>>61942383

You fuck off with that shit too.
>>
>>61942411
this
Or D
>>
>>61942421
But James, I just wanna know how to become a good programmer. ;_;
>>
>>61942395

>And if you want to make your own C# implementation for whatever reason, you're still fucked
Nope. What part of free as in freedom don't you get?
>>
>>61942421
>I am called Ruby
That's gay.
Being a tripfag is also gay.
You're double gay.
>>
>>61942421
>crying about people calling you a random name
Youre such a hypocritical twat, if you didnt want the attention, you wouldnt be using a trip.
>>
>>61942449
>license = patent
I'm not a lawyer, but I'm pretty sure these two things are not the same.
>>
>>61942449
>What part of free as in freedom don't you get?
I'm not american, sorry.
>>
>>61942421

Don't get shirty James.
>>
>>61942334
You must be willing to suffer. "It's too hard" is the excuse everyone uses.
>>
>>61942421
feeling frisky huh? post boipucci pls
>>
>>61942421
>That's almost as bad as people calling me a girl.
I thought you were a girl?
>>
spending this much time on a hobby that will at best get you the job of a code monkey
>>
>>61942444

Write code and read other people's code, and you will eventually become a good programmer.

>>61942473

Don't be a cunt, David.

>>61942488

A. This is a blue board
B. No.

>>61942518

I'm not.
>>
File: 1483073157801.jpg (110KB, 1280x720px) Image search: [Google]
1483073157801.jpg
110KB, 1280x720px
Employed Haskell programmer here
>>
>>61942559
What language do you use at work?
>>
File: smug_haskell_programmer.jpg (44KB, 636x616px) Image search: [Google]
smug_haskell_programmer.jpg
44KB, 636x616px
>>61942559
>not using the proper image
It's like you aren't even trying.
>>
File: 979839377774978999.jpg (100KB, 821x695px) Image search: [Google]
979839377774978999.jpg
100KB, 821x695px
>Remember that while MD5 and SHA-1 are both popular hash functions, MD5 is considered completely broken, SHA-1 is considered weak. SHA-2 and its variants are to be crowned the new king.
What did they mean by this?
>>
>>61942556
>I'm not.
I don't believe you, it seems unlikely that you're male.
>>
>>61942571
Idris
>>
>>61942591
it means computers have gotten fast enough to brute force a colliding hash in the space of a few months instead of millions of years as previously predicted

this is going to keep happening until the end of time
>>
>>61942594
The only male thing about him is his fem penis.
>>
>>61942591
Actually SHA-3 is the new standard
>>
Best Python talk: https://www.youtube.com/watch?v=uqsZa36Io2M
>>
>>61942609
So can I still use MD5 to find duplicated files? SHA-2 seems to be slow.
>>
File: fug.jpg (102KB, 425x450px) Image search: [Google]
fug.jpg
102KB, 425x450px
Anyone here gave up on video games? I'm trying to get serious but I always have an urge to play. Longest I can go without games is like 3 days. I'm 28 already and I need to give up games and do shit with my life. I am also addicted to browsing 4chan
>>
At what point do you know that you know the language to at least land you junior position?
>>
>>61942650
When you've been working in a junior position for about a year
>>
>>61942644
I'll give things up for weeks at a time in order to work on a project but then I burn out and go back to video games or anime.
Why would you want to stop doing something you enjoy?

>>61942650
When you can use it without looking up the standard library every 10 seconds.
>>
File: 443174864598.png (445KB, 424x453px) Image search: [Google]
443174864598.png
445KB, 424x453px
>>61942644
DELET
>>
>>61942644

23, they do nothing for me anymore. Blocked all social media websites except dpt.
>>
>>61942643
SHA-3 is faster than MD5
http://keccak.noekeon.org/sw_performance.html
>>
File: sadness.jpg (92KB, 560x555px) Image search: [Google]
sadness.jpg
92KB, 560x555px
What is the best programming language if both my development time and my hardware resources are limited?
>>
>>61942657
>I'll give things up for weeks at a time in order to work on a project but then I burn out and go back to video games or anime.
>Why would you want to stop doing something you enjoy?


So you live a more fufilling life than just short term pleasure to your 30's, then testing how strong the light fittings are.
>>
>>61942644
thats the wrong way to go about it, desu.
You shouldnt dev 24/7 and completely give up vidya.
>>
>>61942667
Lisp
>>
>>61942667
C++17 if you mastered the STL and Boost
>>
>>61942671
What's a fulfilling life to you?
Time you enjoyed wasting is time not wasted.
>>
>>61942667

How limited? And what kind of project is it for?
>>
>>61942673
I'm not talking about going hard on programming 100%, gaming is just too addictive and I would love to change it with something I can stop doing after an hour.
>>
>>61942643
Yes, the chance of an accidental collision in a set of files with MD5 is zero in practice.
>>
>>61942688
Consider if that I need to be productive enough to complete tasks quickly, and the program needs to run with minimal resources.
>>
>>61942696
Try Dota 2. It's so aggravating that you'll force yourself to play less anyway.
>>
>>61942666
tl;dl
Does that require a special set CPU instructions to be that fast? If so, I'm out.
>>
>>61942688
Ruby when did you become a guy?
>>
>>61942696
Do you only play multiplayer or something?
I started appreciating games much more after I went all single player.
Online gaming becomes a repetitive blur and hanging out with stupid kids and 23 year old neets isn't fun.
>>
>>61942687

Spending time with friends, working out and taking responsibility for the people around you. Once you start that depression death spiral it's super hard to come out of it.
>>
>>61942727
G E N D E R F L U I D
>>
File: old_hag_langs.png (173KB, 600x355px) Image search: [Google]
old_hag_langs.png
173KB, 600x355px
Still waiting, "Fortran programmer".
>>61941145
>C for retards
>>
>>61942734
>i'm having a midlife crisis in my 20s

get a grip you loser
>>
>>61942738
Pascal is a semi-pseudo language though.
>>
>>61942734
>Once you start that depression death spiral it's super hard to come out of it
Jesus Christ, go see a therapist then.

t. guy who saw a therapist and is now on anxiety meds and feeling legitimately happy for the first time in years.
>>
>>61942707

You just repeated your original requirements without expanding upon them as asked for. What is the project? What is your deadline? How limited of computing power do you have to deal with?

>>61942727

When I was in my mother's womb.
>>
>>61942749
Exactly why no one likes it, similar to how no one like Skank-nako
>>
>>61942766
Don't fall for this memelord.
>>
>>61942766

I come out the other end bro, but your advice is correct.
>>
>>61942767
I don't want to give too much details. I just want a general purpose programming language that has high programmer productivity and minimal resource usage with speed.
>>
>>61942767
Yes, but when did you transition?
>>
>>61942783
SBCL
>>
>>61942773
I thought therapy was a meme too, but actually talking about my fucking problems with an actual doctor instead of random Anons on the internet a c t u a l l y h e l p s.

The meds wouldn't have been nearly as effective without the pep talks.
>>
>>61942797
he said speed.
>>
>>61942810
I know that many dynamic languages, like Python and JS, are slow, but SBCL happens to be very fast.
>>
I'm actually trying to learn C. I tried to write an ncurses app today.
>>
>>61942823
The last time, i was showed benchmarks which put it 9/10 times slower than java.
>>
>>61942731
I play bunnyhop maps on csgo. Literally waste 3 to 4 hours a day on it. I waste 4 more hours watching videos and browsing 4chan.
>>61942713
dota doesn't give much pleasure per minute since you spend time dead so much. It feels like a time waste. For the same reason I don't play ranked csgo.
>>
So, in Linux there are full fledged programs (not just libraries) that are installed as a dependency of bigger programs. for example, ffmpeg is required for many video tools.

I want to use radeonsi-git as a back end to my task manager. radeonsi is a full fledged program on its own. How do I integrate this program to mine? How would I call radeonsi from my program?
>>
>>61942731
This I hate to say it but I'm literally becoming a "dad". Term /edg/ uses for middle aged guys who only have few hours a week to play.
>>
>>61942783

Performance and programming time both fit on a spectrum, so it's very difficult to guess what you need. If you're working on a machine where your memory requirements are in kilobytes, or maybe 1 or 2 megabytes, you're probably going to be using C, or maybe C++ if it's on a more common platform. Where C++ is viable, Rust can also be viable (unless you have certain library requirements), though it is worth noting that to effectively make use of either of these languages, you need to sink some time into learning them proper.

If you have a bit more memory to spare, and expect your project to be a long-running program, rather than one that is run several times a minute, a language that compiles to bytecode and is run on a virtual machine such as the CLR or JVM, may serve your needs well. You have less to worry about memory management, and can run reasonably fast after the VM has had some time to get things cached and JIT all of the code.

If the memory cost of such a language is too high, you should stick to C++ or Rust. If the memory cost is acceptable, but you would rather trade runtime performance for more productivity, switch to a dynamic language such as Python or Ruby.
>>
>>61942788

I have never done any such thing. I have always been a man.

>>61942887

fork() and exec() or just run a shell script.
>>
>>61942938
On the inside maybe, but when did you change the outside?
>>
>>61942938
>I have always been a man.
But you said you became male at one point in >>61942767. You can't keep your story consistent. I'm gonna be honest, it's not looking good for your claim of being male.
>>
File: 1418081126229.gif (3MB, 1280x720px) Image search: [Google]
1418081126229.gif
3MB, 1280x720px
>>61942836
Good job, Anon!
>>
>>61943063
*molests*
>>
File: Ovadia_Yosef.jpg (58KB, 245x327px) Image search: [Google]
Ovadia_Yosef.jpg
58KB, 245x327px
in CSLR when it gives the algorithm for searching BST's it says that the iterative version is more efficient than recursive, why is this?
>>
>>61943392
Which page?
>>
>>61943412
Bottom of 290
>>
>>61943392
Archaic farce given most languages ability to do TCO.

In the recursive, without TCO, you would have to actually save intermediate results on the stack, which is completely unnecessary for a search. Maybe a full traversal, but not a search.
>>
>>61943392
Recursive process =/= recursive program

SICP chapter 1
>>
>>61943435
Because what anon said >>61943444
Basically, to make a function call requires putting arguments onto a stack then jumping to the next function. This uses up more memory as you are basically putting data on the stack which you don't need anymore since you are only doing a search.
>>
>>61943444
TCO isn't something that can be applied to every recursive function, only specific functions. Especially in the BST algorithm given in CLRS which you wouldn't be able to TCO anyway. Also some language nowadays don't use TCO or guarantee TCO, notably Python and Rust.
>>
It's 2017 and the JVM still doesn't have value types or TCO. How is this even possible?
>>
Is there a way to force matlab compatibility when using octave?
Or is there some way to easily convert from octave compatible to matlab?
>>
>>61943604
I don't think such a thing is feasible.
The two software use the same language but Octave only has a subset of the functions, or is not compatible with every combination of arguments Matlab supports.
I'm afraid you have to convert manually.
>>
>>61943549
Stop using Java
>>
>>61943549
>TCO
Total Cost of Ownership?
>>
>>61943710
>>>61943549
>>TCO
>Total Cost of Ownership?
Tail Call Optimization
>>61943549
>It's 2017 and the JVM still doesn't have value types or TCO. How is this even possible?
Many language nowadays dont use tco bevause they wsnt meaningful stack traces, like go.
>>
File: 1472034764327.png (399KB, 1000x800px) Image search: [Google]
1472034764327.png
399KB, 1000x800px
>>61943710
Total Cunt Obliterator
>>
So how is Kotlin? A meme? Actually good?
>>
>>61941121
C++
>>
>>61943707
I'm not using Java.

>>61943710
Tail call optimization
>>
>>61943783
A wasted opportunity.
>>
>>61943856
Why?
>>
>>61943873
Far too conservative.
>>
>>61943880
Oh, so that's why it made it onto android.
>>
>>61943895
What I mean is that its type system is barely better than Java's.

Look at Scala for a more capable type system. It gets a lot wrong, but it gets a lot right too.

Adding a new language is an opportunity to really improve things. Kotlin only slightly improves things.
>>
What reasons would you have to work in standards like c89, c99 etc. over c11 other than working on legacy systems?
>>
>>61943997
In embedded systems, anything other than C89 compliance is a luxury.
Non-standard GNU extensions also prevent you from using compilers like clang which CLAIM to be GNU compatible but simply IGNORE all __attribute__() modifiers when given.
>>
>>61939306
your memmove args are fucked bro
>>
>>61944030
how?
>>
>>61943997

Windows drivers. You're basically forced to use MSVC, which doesn't support C11.
>>
>>61939306
>while (--j)
Trying to be too clever, just use a fucking for loop.
>memmove(&arr[j + 1], &arr[j], i - j);
This is fucking dumb, you are passing an integer array and are using memmove, just fucking swap the values, unless you are trying to make it portable for other data types, in which case you are doing it wrong.
>>
>>61944073
>doesn't support C11

Not him but how is this possible? A company with insanely deep pockets that hires the best minds in the world loses out to a toe-jam eater and his hippie henchmen?
>>
>>61944073
>MSVC, which doesn't support C11.
kek I'm tempted to move completely to C11
>>
>>61944076
I'm used to using memmove for char * arrays, so I completely forgot that the last value is literal bytes.

Also this would look clunky as shit rewritten as a for loop.
>>
File: 1498430950893.jpg (234KB, 1577x987px) Image search: [Google]
1498430950893.jpg
234KB, 1577x987px
>>61944088
>hires the best minds
Micrtrash is a pajeet company now, and it's beyond redemption
>>
>>61944073
Who are you? Why do I see you in all these threads?
>>
>>61944097
>>61944076
How do you like my all new insertion sort?
void insertion_sort(int *arr, int len)
{
unsigned i, j;
for (i = 1; i < len; i++)
{
j = i;
while (--j && arr[j] > arr[i]);
if (j < i) /* found */
{
int tmp = arr[i];
memmove(&arr[j + 1], &arr[j], (i - j) * sizeof(int));
arr[j] = tmp;
}
}
}
>>
>>61944169
>works with ints only
>>
>>61944214
I have the option of writing it like cstdlib's qsort or as a template macro.
>>
>>61944088
Because none of Microsofts paying clients, or Microsoft themselves use C11? They still don't have a fully C99 compliant compiler or standard library. The parts of the NT kernel that are written in C use ANSI C, with some Microsoft extensions -- which get compiled by a C++ compiler with a 'C quirks' mode.

Speaking about C11 though, not many mainstream compilers fully support it. Most refuse to implement the optional features (Annex K, Annex L, etc). GCC still isn't even compliant with the required standard because of issues inside of glibc. And to be honest, most of the standard stuff added in C11 is generally pretty useless when its already existed as a gnu99 (non portable, though) extension, or thru library features (eqv. of stdatomic, etc). Things like the _Noreturn attribute can be done with pragmas, which already exists in C99 (for gcc/clang: _attribute__((noreturn)) and msvc: __declspec(noreturn))

And to not ignore the elephant in the room, _Generic is quite ugly and I wonder how the last 35-40s years of C have managed without being able to use it..

In my opinion, there's no reason to use C11. Unicode? Thats a portable library issue, not a standard library problem. Which unicode? UTF-8? UTF-16? MBCS? UCS-2? Oh, its locale and implementation dependent? Then why not just #include ICU or similar (depending on your project needs.). Anonymous structs and unions? Fuck, you got me there, literally the only feature. But it already exists in C99 MSVC and gnu99 specific extensions (and Clang generally defaults to GNU C11..).

But idk, I write C++ because I'm not living in the 80s.

>>61944221
What about C11 _Generic :^)
>>
>>61944253
anonymous structs and unions have been supported by every compiler worth using since before C89 was even standardized
>>
>>61944253
nogenerics.info
>>
>>61944040
looks like u figured it out
>>
>Be pajeet
>Open a github account with "Jefferson"
lmfao
>>
>>61944271
>nogenerics.info
Thats clever. (But calling _Generic "Generics" is an insult to Phillip Wadler. Its a "Go 2"-tier solution to the problem-space)

>>61944267
Exactly, which is why C11 is pretty much pointless.
>>
>>61944073
It doesn't even support c99
>>
>>61944299
non-standard anon-structs aren't supported by MSVSC
>>
>>61944308
>worth using
>>
C11 master race
>>
Does this mean this guy doesn't know shit?

https://matt.sh/howto-c
>>
>>61944308
/Ze enables them. With all of the other Microsoft extensions (most are actually C++ extensions that have an internal quirks mode if it can determine the file is actually C and not C++). Just like using -std=gnu99 with GCC / Clang will let you use anonymous structs pre-C11
>>
>>61944097
>>61944169
I think your implementation is broken because for j = 0, it is false and exits the loop too early when j = 0 could actually be a valid index to insert into. Have you actually tested it though?
>>
>>61944346
he deleted the comments section because it was entirely full of grown men calling him a retard
>>
>>61944386
That's because he is retarded tho.
>>
Is it possible to replace text with / or \ characters in sed?
>>
?
>>
I'm currently working through the K&R C book, and I have a quick question about style. Is there a specific reason why functions are written in the style of
main()
{


as opposed to
main() {


Is it just the style of C code, or is there a specific reason why the curly bracket is on the next line?
>>
>>61944575
depends on people, i always use the former, but the latter is nice too
>>
>>61944575
use clang-format to format your code, your editor should take care of this for you, I suggest using the WebKit or Mozilla indentation rule. Both are good.

To answer your question, it's only a matter of your taste. Legacy formatting style like K&R, Allman, GNU have different features.
>>
>>61944575
You can do either, and you'll have endless amounts of people from both sides yelling at you to use the one they think is superior

protip: 1st style is better
>>
>>61944598
This
Writing ANSI C++ with Mozilla standard indents is pretty comfy
>>
>>61944575

https://en.wikipedia.org/wiki/Indent_style
Pick one and stick to it.
>>
>>61942675
With sbcl
>>
>>61942823
Because it actually compiles lisp to asm i think
>>
>>61943783
Better than java at least lol
Clojure is still the best for jvm tho
>>
File: 19748717.jpg (46KB, 545x960px) Image search: [Google]
19748717.jpg
46KB, 545x960px
Am I doing it right?

http://ideone.com/kgYmTV
>>
>>61944333
>implying you use _Generic
>glibc still doesn't support C11 threads
The only usable thing there are the alignof and related functions which are already in the POSIX.
>>
Will C22 standardize #pragma once?
>>
>>61944839
>implying he doesn't use unnamed structs and unions
>>
>>61944775
http://ideone.com/GToZa2
even if you mean to turn this into a proper poker game, you're still overthinking it
>>
File: casual-cia-57de462598c8c.jpg (191KB, 2048x1360px) Image search: [Google]
casual-cia-57de462598c8c.jpg
191KB, 2048x1360px
Hello, I'm a stinky millennial. How do I into mailing lists?
I've never used them and am pretty confused by the idea.

Is there something like what Slack is to IRC -- a sleek wrapper around a basic concept that hides "rough edges" and makes the whole thing easier to swallow?
>>
>>61944884
thanks
>>
>>61944775
you should be passing by const reference in C++, senpai.
if you aren't modifying the pointer, then use a reference. if you are modifying the pointer -- use a smart pointer.

also, this isn't valid C++:
card{.suit = s, .rank = r };

>ISO C++ does not allow C99 designated initializers.

also, why new / delete[]?
  card* test = new card{.suit = int(Suit::Heart), .rank = int(Rank::Four) };
// ...
delete[](deck);
>>
>>61944930
basically those are just email, you send an email and everybody receives it and vice versa. There are kind of sites that render them as a forum, but it's read only and basically are made so you can find mailing list's content w/ google
>>
>>61945068
reference feels somewhat hard to track for me, if I'm passing a pointer to a function, I know it's a pointer.

>card{.suit = s, .rank = r };
http://en.cppreference.com/w/c/language/struct_initialization
says its fine

>why new / delete[]?
Don't want to overflow the stack
>>
>>61945106
That is for C. Its even in the URL.
>Struct and union initialization
>C
>C language
>Initialization

I was being subtle with a jab at not using
std::make_unique<card>()
std::make_unique<std::array>()

You should never have to manually call new/delete in C++.
>>
>>61945068
>>61945106
Clang and GCC supports it, it's not native C++
>>
>>61945138
Oh, I haven't reached smart pointers' chapter yet
>>
>>61945106
you can store an entire deck in 52 bytes if you bitpack like so.
cards[k++] = (i << 4) | j

you already have integers 0-4 and 0-12 defined as enumerated values, so you can get those values back when it comes time to read the cards back.
>>
>>61945140
It should be an a compiler error if you're using proper flags. (-Wpedantic -Werror).

Say you have this:
struct Foo {
int a;
int b;
int c;
};

int this_is_ugly = 5;

int x() { return this_is_ugly++; }
int y() { return this_is_ugly--; }
int z() { return this_is_ugly * this_is_ugly; }

Foo f = {.b = x(), .c = y(), .a = z()};
// what is f.a, f.b, f.c?


C++ will evaluate x, then y then z, but C will evaluate it as ??? because (although all 3 major vendors have agreed on having consistent behavior).

From the C standard.
>The order of evaluation of the subexpressions in any initializer is indeterminately sequenced

From the C++ standard:
>Within the initializer-list of a braced-init-list, the initializer-clauses, including any that result from pack expansions (17.5.3), are evaluated in the order in which they appear. That is, every value computation and side effect associated with a given initializer-clause is sequenced before every value computation and side effect associated with any initializer-clause that follows it in the comma-separated list of the initializer-list.

Using the C form may work, but it may not because the compiler is required to implement the behavior of C++-style initialization, not the C style.
>>
>>61945227
>mutating a global variable
>>
>>61945227
That's not the fault of designated initializers though
>>
Does anyone here have experience using lldb?
When debugging something as simple as this:
#include <stdio.h>

int main () {
int i;
for (i = 0; i < 199; ++i) {
printf("%i\n", i);
}
return 0;
}

Setting a conditional breakpoint such as "br -l main.c:6 -c 'i == 19'" will make lldb stop when i is 19, but then using "next" twice in order to run two iterations of the loop will make the program run till its end instead. How can I make lldb run two iterations instead?
Binaries are compiled with gcc -g -O0
>>
>>61945254
T'was a terrible example, hence the name. But the easiest to demonstrate. Say you're messing with the this pointer and you're changing stuff in your initializer (or your base class -- or derived class if you're a big fan of CTRP), the same thing can happen.

>>61945265
Because they don't exist in C++. Brace initialization is a very core, and important principal in C++.

>>61945227
And I forgot to add how to do initializer lists in C++:
struct Foo {
Foo(int a, int b, int c) : a(a), b(b), c(c){};

int a;
int b;
int c;
};

Foo f{1,2,3};
// or
auto f = Foo{1,2,3};

// bonus for default values with a compiler-generated ctor..
struct Bar {
int a{42};
};

Its more typing, but thats C++.
>>
Why isn't this a bad idea? Chances are, more than 1 card in the deck will have the same rank and suit.

I'm just going to swap with a card that's constantly higher in the deck index, and have it wrap if it reaches card number 52+
>>
>>61945405
Scan the whole deck if that card exists before inserting it.
Don't be dumb
>>
>>61945405
I think you don't understand the instructions. For each element, you pick a number between 1 and 52. This means that card 52 can still be swapped with card 1.
>>
I'm seriously thinking of switching to C++ from C because of operator overloading (matrix/vector math) and better standard library support.
>>
>>61945597
Try it. You won't hate it until you've dug deep enough for it to bite you in the ass though.
>>
File: 1429037809603.png (160KB, 463x179px) Image search: [Google]
1429037809603.png
160KB, 463x179px
>>61944775
I finished it. Can't into unique_ptrs right now because that's like chapter 15
https://ideone.com/7vxgrK
>>
>>61942644
Are you me? Basically the best thing to do is just accept that you're a failure and embrace your pathetic life to the fullest by playing games even more.
>>
Some ext.js garbage for work.

I want to die.
>>
>>61944575
It doesn't matter which one you use, just be consistent and don't alternate.
>>
>>61945828
Why does webdev induce suicidal thoughts :thinking:
>>
>>61944575
I use the second one except when the line is too long and I have to split it, then I use the first one.
>>
how to set my custom icon in WNDCLASS anons? why cant i just point to an image file

>dumb_pepe.jpg
>>
File: dumbfucks.jpg (384KB, 980x606px) Image search: [Google]
dumbfucks.jpg
384KB, 980x606px
Who the fuck was so retarded to think that allowing using functions without a declared prototype as external linkage functions with FUCKING "DEFAULT" arguments was a good fucking idea? Is this fixed in C++?

// will be even more after refactoring and resulting granularization
static void initGame(const char *levelPath, const char *framesPath, const char *sframesPath);
static void exitGame(void);
static unsigned long tick(void);
static void camera(void);
static void moving(void);
static void switchHeroes(void);
static void collision(unsigned long n);
static void doStaticCollision();
static void doFull(void);
static void doCornerSouthWest(void);
static void doCornerSouthEast(void);
static void doCornerNorthWest(void);
static void doCornerNorthEast(void);
static void doSouth(void);
static void doNorth(void);
static void doWest(void);
static void doEast(void);
static void doDiagSouthWestNorthEast(void);
static void doDiagSouthEastNorthWest(void);
static void doSouthWest(void);
static void doSouthEast(void);
static void doNorthWest(void);
static void doNorthEast(void);
static void doEmpty(void);
static float penSouth(void);
static float penNorth(void);
static float penWest(void);
static float penEast(void);
static float vecLen(float x, float y);
static void doHeroCollision(void);
static void collectCoins(void);
static void collectGravitons(void);
static void doPulsatorCollision(unsigned long n);
static void doShrinkerLogic(void);
static float getShrinkerSize(size_t i);
static void doEjectorLogic(void);
static void killHero(void);
>>
>>61946128
>with FUCKING "DEFAULT" arguments
wat? I know about the implicit declaration thing, which isn't C++, but I don't know what you mean by this
>>
>>61946163
default promotions are applied (anything smaller than int -> int, float -> double), return type defaults to int. As of C99 they're forbidden, but you still have to crap your code with needless prototypes when there's literally no need and compiler could figure that shit out very easily by itself. The year is 2017.
>>
>>61939273
I automate shell on aix.
Is it programming?
>>
>>61946163
>this isn't C++
That's why I'm asking if this is fixed in C++. I got memed into C.
>>
>>61946201
And I'm telling you, you need to declare your prototypes in C++.
>>
>>61946220
Is this going to get fixed with C++20? The compiler can extract the prototypes from the translation unit without a programmers help.
>>
File: 13664030903.jpg (95KB, 600x672px) Image search: [Google]
13664030903.jpg
95KB, 600x672px
>software that can't update itself inplace
>>
>>61946188
You're saying that if you were to call a function in one translation unit with no declaration like this
short s = 10;
float f = 0.1f;
func(s, f);

The implicit declaration would be
int func(int, double);
>>
>>61946232
It was removed intentionally. Why aren't you including your headers?
>>
>>61946232
That's never going to happen kek
>>
>>61946254
>2017
>blindly pasting code into the source and then compiling it
>>
>>61946237
>software needs to update
>>
>>61946238
Yup. In C89, at least, it was. As of C99 and later, implicit functions are prohibited.

>>61946254
I *am* including my headers. I don't want clutter my code with needless prototypes. That's redundant.

>>61946255
Why? That would be a nice feature.
>>
>>61946270
One more reason not to use C89 I guess. The last thing I want is my compiler guessing what I meant.
>>
cpp

whats the difference between

 
static int foo();
int foo();

??

in java its pretty obvious when to use static (when its a function that does not belong to any class) but in cpp this is not so obvious, i have a bunch of functions in a seperate file that does not contain any constructor or whatever but it compiles just fine.
>>
>>61946337
static has about 4 different meanings depending on context.

If the symbol isn't part of a class, then static means that it won't be visible to the linker. It's roughly the same as "private"
If the symbol is being declared inside of a class then static means the same as in Java.
>>
File: 1461186573800.jpg (16KB, 399x297px) Image search: [Google]
1461186573800.jpg
16KB, 399x297px
>>61946270
>In C89
>C89
>eighty freakin nine
Why would you ever, in this day and age?
>>
>>61946401
C99 onward isn't portable and C++98 onwards really isn't portable.
>>
>>61946401
Because portability
>>
>>61946128

Isn't that the default for most languages? I mean, it's shit. I don't understand its existence. But a lot of languages do it.

It was even built into fucking Solidity

https://medium.com/@raulk/the-latest-ethereum-hack-a-500-word-postmortem-and-summary-7db6c166cb71
>>
>>61946410
>>61946411
Why would you be interested in writing software for PDP-10?
>>
>>61946424
Why would you choose a language that limits your portability?
I'm not specifically targeting PDP-10 but leaving it out for no reason makes no sense, dumb webdev poster.
>>
>>61946436
What platform can't I run C99 or even C++11 on?
>>
>>61946436
>Why would you choose a language that limits your portability?
If the computer I'm targeting can't run C99 then it probably can't run my programs either.
>>
>>61946445
Windows
>>
>>61945901
Do you have a resource editor? (as in, are you using Visual Studio?)

If you want to have an icon on your exe you'll have to use a resource editor.
If you just want to load an ico or png or whatever from disk at runtime and use that as the window icon (titlebar, in the shell (alt-tab), etc) then you can use the LoadImage function.
    HANDLE icon = LoadImage(nullptr, "path/to/my_icon.ico",
IMAGE_ICON, // or IMAGE_BITMAP or IMAGE_CURSOR
0, // h
0, // w
LR_LOADFROMFILE | LR_DEFAULTSIZE);

wc.hIcon = static_cast<HICON>(icon);
wc.hIconSm = static_cast<HICON>(icon); // for small icons (WNDCLASSEX)


>>61946337
Static means a few things in C++. One means static storage, one controls its linkage and another means its not being to an instance.

The third is what you're thinking of from Java, where its not an instance method of the class
class Foo {
// don't need an instance of Foo to call Bar();
static void Bar();
};

// static storage -- stored in the same place for the duration of the program (or in a thread-local storage since C++11..)
// also has "internal linkage"
static int answer = 42;

// not visible outside of this translation unit (internal linkage)
static void Bax();

// bonus: is visible outside of the translation unit, but has static storage (external linkage)
extern int answer = 42

// more bonus: equivalent to declaring both as static
namespace {
void Foo();
void Bar();
}
>>
I need help, I'm going crazy trying to debug something. This should always be true, shouldn't it?
 i = 0;
for (y = 0; y < matrix.length; ++y) {
for (x = 0; x < matrix[y].length; ++x) {
if matrix[y][x] != matrix[i / matrix.length][i % matrix[y].length] {
return false;
}
++i;
}
}
return true;
>>
>>61946436
>Why would you choose a language that limits your portability?
Because I already chose libraries (OpenGL ES 2.0, GLFW 3, libsoundio) that already limit my portability to the three major desktop operating systems.

With some work my abstraction layer could be ported to android/iphone (NDK) and consoles (idk if xbox supports C but PS does, I think).

Anyway, none of platforms that do have support for graphics wouldn't have support for C11 compilers.
>>
is visual basic a useful language to learn?

I don't know a lot about it but I've been screwing around using VBA in excel to make macros at work and I'm wondering if VB might be useful to make small windows programs or something

are there better options for creating GUIs?

I've never really made anything in any language that does much besides calculate stuff or read/write files
>>
>>61946504
not really, use c# or something
>>
>>61946462
Do GCC and Clang not work on Windows?
>>
>>61946504
C#, or VB.net (if you're that kind of person).
or Qt + C++ if you want something a bit more crossplatform, and/or if you want more control.

VBA reeks of classic VB which is outdated trash.
>>
New thread:

>>61946541
>>61946541
>>61946541
>>
>>61946517
MSVC support most of C99 and all of C++11. (since 2015, the third vesion of 2017 is out which has more than half of C++17 (C++1z) implemented..)

But Pelles C supports all of C99 and is rather fast/lightweight. Perfect as long as you don't need high-end compiler optimizations.
>>
>>61946517
MinGW-w64 is on Windows and it supports a lot more shit than MSVC.
>>
>>61946410
>>61946424

>Put C code on GitHub
>Immediately get an issue demanding autoconf
>Why?
>"muh portability"
>Can anyone name any platform it's not currently portable to?
>"Z/OS on IBM mainframe"
>Does anyone actually have access to that platform and the desire to at least show me an error in the current state?
>"muh portability. Must have autoconf".
>>
>>61946504

It's great if you want to be an accountant and "write code" without ever writing code anyone respects.
>>
File: i understood FUCKING NOTHING.png (19KB, 1044x200px) Image search: [Google]
i understood FUCKING NOTHING.png
19KB, 1044x200px
>>61946468

where in this description does it say file path?
>>
File: here.png (51KB, 1120x717px) Image search: [Google]
here.png
51KB, 1120x717px
>>61946674
Scroll down.
>>
Is this true, /g/?

>>>/v/387401257
>>
>>61946746
yes
>>
cpp

are there any instance where this will fail?

#define array_count(array) (sizeof(array) / sizeof(array[0])) 


??
>>
>>61946938
I don't know cpp but in C this would fail for heap-allocated arrays.
>>
>>61946938
When array isn't an array, but a pointer.
>>
>>61946938
Why not do
#include <iostream>

const int ARRAY_THING[] = {1, 2, 3, 4, 5};

int main()
{
for (int i = 0; i < std::extent<decltype(ARRAY_THING)>::value; i++)
std::cout << ARRAY_THING[i] << '\n';
}
>>
>>61946977
That's cool, I think.
>>
>>61946977
>>61946986

cpp newbie here, can you tell me whats happening exactly? the one that i wrote seems intuitive enough when thinking in the literally bytes written in the memory
>>
>>61947058
The macro can compile but give you an invalid result (e.g. if you give it a pointer). std::extent is typesafe.
>>
anon how do you react to user input in winapi?

what i do is have a struct containing booleans for acceptable key inputs like up,down,left and right, then have win_call_back set the boolean when buttons are pressed

then pass this struct to the my game engine
>>
>>61947098
I'd listen for the WM_KEYDOWN message that puts the key (and related state/data) in a threadsafe queue / time series queue that the game loop reads within a specific delta (and clears out previous entries from the past). Similar to how GetMessage / TranslateMessage / DispatchMessage works.
>>
>>61946938
sizeodf((array)[0])
Thread posts: 338
Thread images: 35


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.