[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 Perentie 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: 316
Thread images: 58

File: 21-Perentie-Goanna.jpg (686KB, 1200x900px) Image search: [Google]
21-Perentie-Goanna.jpg
686KB, 1200x900px
What are you working on, /g/?

Previous thread: >>60628373
>>
First for C
>>
Ignore post above.
First for C++
>>
File: old_hag_langs.png (173KB, 600x355px) Image search: [Google]
old_hag_langs.png
173KB, 600x355px
>>60635991
>>60636006
Both fine answers, as long as by C++ you mean C++11.
>>
What the name of this problem?

>subset of the integers between 1 and n, of maximal length and no element in the subset the average of other two in the subset
>>
>>60636012
It's the Your problem.
>>
>>60636011
>C++11
Was thinking more of C++17 but that works as well.
>>
>>60636011
All versions of C++ are fucking trash.
>>
>>60636094
>not using C++20
>not using atomic smart pointers and coroutines

plebs out
>>
File: dlang_chan.jpg (139KB, 470x545px) Image search: [Google]
dlang_chan.jpg
139KB, 470x545px
Threadly reminder that dlang-chan is not dead; she's going to have her GC tumor removed (eventually); she's super duper cute; and she's a blast to write in! Say something nice about her, /dpt/!

>Features
https://dlang.org/comparison.html
>Standard library
https://dlang.org/phobos/index.html
>GC
https://dlang.org/spec/garbage.html
https://dlang.org/blog/2017/03/20/dont-fear-the-reaper/
https://dlang.org/blog/2017/04/28/automem-hands-free-raii-for-d/
>Books
https://wiki.dlang.org/Books
>>
File: 1495990194488.jpg (192KB, 1407x867px) Image search: [Google]
1495990194488.jpg
192KB, 1407x867px
>>
>>60636203
Stop spamming these threads, you fucking necrophiliac.
>>
>>60636213
>one post a thread
>spam
Nah
>>
>>60636220
How is posting the same stupid shill shit every single thread not spamming?
>>
>>60636220
noun
1.
irrelevant or unsolicited messages sent over the Internet, typically to a large number of users, for the purposes of advertising, phishing, spreading malware, etc.

spam != flooding
>>
>>60636245
>>60636249
It's not. Stay mad that somebody enjoys something.
>>
>>60636211
>RAD studio
>.pas

is that

delphi?
>>
>>60636203
Can I link Ada to D?
>>
>>60636249

Or in simple terms...

Stupid
Pointless
Annoying
Messages
>>
>>60636405
Really
Useless
Boring
Slag
>>
>>60636399
Tomboys aren't lesbians, anon.

>>60636405
Says the tripfag.
>>
File: 041248.webm (3MB, 540x960px) Image search: [Google]
041248.webm
3MB, 540x960px
>>60636211
>>
File: rubs.png (14KB, 608x157px) Image search: [Google]
rubs.png
14KB, 608x157px
>>60636418
forgot pic
>>
>>60636428
cool clock, ahmed
>>
>>60636293
[x] unsolicited
[x] large number of users
[x] advertising
wow it checks all the boxes
>>
>>60636418

Rubs? Couldn't think of an insult starting with Y?
>>
>>60636428
>blink speed doesn't update until the mouse is released
Disgusting
>>
>>60636427
What do you mean?
>>
>>60636457
There's no Y in rubs
>>
>>60636455
Sorry, anon. But dlang-chan is a programming language. And this is a programming thread. Thus it's not unsolicited. If you don't want to see it, just scroll by. I only post it once a thread. Have a nice day.

>>60636481
She doesn't "link" with girls.
>>
>>60636496
Thanks for setting the record straight
>>
What's a good 2D C library?
>>
Only cucks and brainlets need comments, pros can understand it without needing comments.
>>
>>60636586
we could do without this comment
>>
>>60636427
What if I export as a c function?
>>
>>60636669
https://dlang.org/spec/interfaceToC.html
>>
>>60635941
Can someone give me an explanation of pointers and a example please. if possible in Java or C. Also how different is this from an array
>>
>>60636678
But how would you compile it?
>>
File: goanna.jpg (874KB, 860x1152px) Image search: [Google]
goanna.jpg
874KB, 860x1152px
Perentie likes cuddles.
>>
File: smug_ran4.jpg (465KB, 565x800px) Image search: [Google]
smug_ran4.jpg
465KB, 565x800px
>he (((komments))) his (((((kode)))))
>>
Lizards are a bro tier pet.
>>
>>60636758
why does she have animal ears and tails
>>
>>60636848
cosplay
>>
>>60636726
https://wiki.dlang.org/D_binding_for_C#Introduction
>>
How does Wine work? The program I want isn't on Wine so I'm thinking I may as well try to do it myself. Can someone give me a quick rundown
>>
>>60636848
>>60636861
Watch your mouth, that's my wife you're talking about.
>>
>>60636905
I'm fucking your wife and now you're a cuck.
>>
>>60636905
You married a jpeg?
>>
>>60636901
it translates windows syscalls to linux syscalls as best as it can, so the program thinks it's running on windows
>>
Do we have one of those "roll" images for casual projects to do just for flexercising development?
>>
>>60636905
You married a furry?
>>
What possible reason could I have for writing rust over C?
>>
>>60636932
is there a good dev guide somewhere? i can't seem to find what I'm looking for on the wine wiki
>>
>>60636956
There isn't one.
>>
>>60636956
Rust is:
- safer and easier to program without memory bugs
- much easier to install libraries with its own package manager
- more modern language features to help program
>>
>>60636721
pls halp
>>
>>60636892
Seems like more work than it's worth, tbqh.
>>
File: eirin_rape.png (28KB, 237x269px) Image search: [Google]
eirin_rape.png
28KB, 237x269px
>>60636956
Rust holds your hand.
>>
>>60636758
>he (((assumes things))) about (((((people he hasn't even spoken to)))))
>>
>>60637021
There's probably some automation program for this that'll do most of the work.
>>
>>60636721
>>60637013
pointers point to objects in memory. if you have an object (e.g. String yourName) and you pass it to a method, you're passing the pointer/reference of that object instead of the value itself

this means you're modifying the object in memory when you manipulate it through the method, whereas if you pass a value it makes a copy
>>
>>60636758
>>60637049
This is your brain on memes
>>
>>60637052
That's why I like Gnat, since I barely have to think about it.
>>
I'm making an arcade style game where you play as a shota and there are many black pedo dicks advancing from below that want your butt so you must ward them off by pooping and eat all the burgers that are falling from above so that digestion will gradually restock your ammo over time but also you shouldn't eat so much so fast so inevitably the shota gets fat and therefore slow the more you play which creates a difficulty curve and the goal is to get as fat as possible without being raped
>>
Looking for recommendations on whats a good C++ graphics library to use to draw candlestick charts?
>>
>>60636721

Just read this:
http://cslibrary.stanford.edu/102/PointersAndMemory.pdf
>>
>>60636721
say your object was a dog. if you passed it by pointer you'd be like
>"here have this dog"
>gives leash
but if you passed it by pure value you'd be like
>"here have this dog"
>picks up entire dog
>fucking astrally projects a duplicate dog into the other guy's arms
>>
>>60637214
Pass by pointer:
>"Hey can you take the dog for a walk?"
>hands off the leash
Pass by reference:
>"Hey can you take the dog for a walk?"
>picks up entire dog
>thrusts it into the other guy's arms
Pass by value:
>"Hey can you take the dog for a walk?"
>keeps the dog
>instead gives the guy a photo of the dog and directions to the pet store
>>
>>60637292
this is stupid

all passing is pass by value.
you're either passing a reference (pointer) or a complete copy of the object.
Both are values, or a collection of values described by a compound type.
>>
>>60637357
>all passing is pass by value.
You are going to make someone fail his CS lesson with your post
>>
>>60637357
Pass by reference implies implicit passing
>>
File: Untitled-1.jpg (90KB, 800x600px) Image search: [Google]
Untitled-1.jpg
90KB, 800x600px
>>60637055
>>60637214
ok so from what i understand, it will give you the address or the value it self instead of copying it. Im guessing that when it copies, it also uses more memory. also here is another question.
>>
>>60637366
>>60637367
I forgot that modern languages destroy this simple model by making a distinction between 'reference' and pointer.

What the fuck is a CS degree even good for?
>>
>>60637357
>all passing is pass by value.
Wrong. Suppose you have
int do_thing(int* x);

How are you passing the int?
Obviously you're passing the pointer by value. But that's not what I'm asking. How are you passing the INT?
The answer is that you're passing it by pointer.

Not to mention, consider pass-by-name semantics. How can you figure your way around calling THAT pass by value?
>>
File: 1486354555076.gif (4KB, 344x326px) Image search: [Google]
1486354555076.gif
4KB, 344x326px
>>60637378
>>
File: yukari_disgust.png (29KB, 287x201px) Image search: [Google]
yukari_disgust.png
29KB, 287x201px
>>60637378
Maybe reddit is more your speed.
>>
>>60637407
A pointer is a value, and systemically, it's just a signed long integer.
>>
>>60637397
C's always been pass by value
>>
>>60637421
Yeah but what are you passing what it points to by?
>>
File: heh2.jpg (89KB, 900x900px) Image search: [Google]
heh2.jpg
89KB, 900x900px
>>60637378
>people pay money for this shit
>>
>>60637407
The formal argument to the function is a pointer. The pointer is passed by value. The fact that the pointer actually points to an int is not important.
>>
>>60637438
I'm passing a value.
You can write the function to interpret that value as a memory address to a value somewhere else, but that's your problem, and certainly not something that NEEDs this apples and oranges comparison.
>>
>>60637378
>Im guessing that when it copies, it also uses more memory.
Yes, but that memory would be used anyway by calling the function, whether you pass something to it by value or not. Because, when you pass by value, the value is copied onto the stack frame the call is building, not onto the heap
>>
>>60637445
>>60637458
What about pass-by-name semantics though
>>
File: 1493847971657.gif (858KB, 200x267px) Image search: [Google]
1493847971657.gif
858KB, 200x267px
>>60635941
I need advice again /dpt/

I'm the anon who's been learning how to program since January (I wrote two "popular" lua mods, went to reading books and grinding endless C# terminal executables for practice, played around with unity and scripting, just made a JS bot for fun).

I think I want to get into freelance coding. I have a career in construction already which covers money and health benefits but when things get slow I would like to switch freelancing for some pocket money and coding experience that I can put on a resume.

Can anyone explain HOW to get the knowledge required to do it? I'm aware of the sites like upwork and I am comfortable with C# (and not opposed to learning C/C++). What is the next step I should take? Right now I'm hobby learning dev and I want to make the jump to => amateur freelance dev.

Thanks /dpt/
>>
>>60637486
Could you post an example?
Maybe you're describing something simple with some backwards terminology, like java calling functions methods and static meaning extern when it shouldn't be visible outside the translation unit.
>>
>>60637523
Pass by name is weird, unlike jave which is simply pass by value.
>>
/dpt/ why does C need a call stack? couldn't it instead set up a compile time graph with each function as a vertex and each call as an edge, and then run the program by doing a depth first traversal of that graph starting at main and tracking the color and parent of each vertex?
>>
>>60637549
Because C allows unrestrained recursion.
>>
>>60637523
I don't know of any languages that actually do this but pass by name is where parameters aren't evaluated until they're first used and passing to a function doesn't count as using. So you could be passing around an unbound variable for example and not find out until somewhere on the callstack an attempt is made to get a value from it or assign a value to it. Or you could be passing around a balanced but syntactically invalid expression and not find out until the result of evaluating that expression is needed by some function kilobytes upon kilobytes deep into the stack
>>
>>60637421

>signed long integer
People who believe that the long data type has anything to do with the size of a pointer are morons. This model completely breaks down as soon as we say we're not dealing with a Unix system. On Windows, which is the largest desktop platform, and unfortunately a sizable server platform as well, the long data type is 32 bits regardless of whether the word size of the processor is 32 bits or 64 bits. Regarding the five base integral types in C (char, short, int, long, long long), the standard has only a few things to say:

1. char <= short <= int <= long <= long long
2. char >= 8 bits, short >= 16 bits, int >= 16 bits, long >= 32 bits, long long >= 64 bits

If you want an integer the size of a pointer, you want either intptr_t or uintptr_t.

Alternatively, you will want ptrdiff_t (signed) or size_t (unsigned). size_t is for representing the size of an object, including an array. ptrdiff_t is for representing the difference between two pointers. Since the last element of an array must necessarily be the result of offsetting a pointer, ptrdiff_t can serve as a signed equivalent to size_t.

Use of these typedefs is the only way to achieve correct behavior across different platforms. Never EVER use long for this purpose.
>>
>>60637590
I use unsigned for calculating difference offsets in pointer arithmetic all the time, stop scaremongering.
>>
File: 1467327366938.png (14KB, 917x1186px) Image search: [Google]
1467327366938.png
14KB, 917x1186px
>>60637409
>>60637420
>>60637443
People dont like gta 3 jokes huh?
https://www.youtube.com/watch?v=xem8Gn9HOcw
http://www.petsovernight.com

>>60637462
is that so, thanks anon and does it even have an advantage to use? copying doesn;t seem like an issue at small scale
>>
>>60637487
Learn Lisp.
>>
File: unnamed.png (16KB, 300x300px) Image search: [Google]
unnamed.png
16KB, 300x300px
>>60637590
Ruby, it's basically common knowledge that you're a boy (female). But also you seem a lot more knowledgeable about things than any natural human being has any right to be, and sometimes you can be conceited or mean (though not nearly as much as most anons). Therefore, I have an important question.


Are you Glados?
>>
>>60637655
>ruby
>boy or knowledgeable
pick one
>>
>>60637655
What he said is not particularly profound or intelligent.
If you've programmed in C past 1999, that's shit that you should know.
>>
File: 1444242952374.gif (503KB, 225x225px) Image search: [Google]
1444242952374.gif
503KB, 225x225px
>>60637655
My ass. He once implicated that all functions return a value.
>>
>>60637590
>People that defend the long data type are morons
FTFY
>>
>>60637655
this is bikeshed-tier shit about language standards, no real substance
>>
File: ran_life.png (50KB, 283x190px) Image search: [Google]
ran_life.png
50KB, 283x190px
>>60637655
>Ruby
>knowledgeable
>shitty manchild vidya reference
>this is the kind of people you're sharing a thread/board/world with RIGHT NOW
Holy shit humanity is doomed.
>>
File: finger.png (139KB, 400x398px) Image search: [Google]
finger.png
139KB, 400x398px
>>60637590
Ruby is such a poorly designed and needlessly complex language. Like, why the fuck does it need to have both 'and' and &&?
>>
>>60637686
all functions do return a value
>>
File: smug_ran1.jpg (180KB, 1732x1593px) Image search: [Google]
smug_ran1.jpg
180KB, 1732x1593px
>>60637712
Functions ARE values you stupid idiot.
>doesn't know that the category of types is a closed compact category
>>
>>60637691
>shitty
Fuck you video games are an artistic medium and portal 2 was a beautiful game with a deep message
>>
>>60637731
>functions ARE values
you stupid idiot.

how does that contradict anything I said?

>the category of types
literally depends entirely on the type system
>>
File: 1473789664891.jpg (80KB, 600x739px) Image search: [Google]
1473789664891.jpg
80KB, 600x739px
>>60637712
Put your trip back on, ruby.
>>
File: 1452715120528.png (651KB, 561x800px) Image search: [Google]
1452715120528.png
651KB, 561x800px
>>60637763
do i look like a girl?
>>
>>60637760
>category of types depends on the type system
>integers depends on the number system
Trip on or fuck off, retard.
>>
>>60637608

I'm less concerned with storing offsets (which the compiler should upcast), and more with storing the pointer itself. Saying that a pointer is just a signed long integer, as Anon was suggesting, is flat wrong.

>>60637655

>boy (female)
Incorrect.

>Are you Glados?
No.
>>
>>60637772
The type system obviously effects what types are like

Are you telling me types are a compact closed category in a type system in which there is only 1 type?
>>
>>60637549
That wouldn't work at all, because functions that have already been called wouldn't be called even if another call to them were encountered. But the idea is interesting.
>>
>>60637777
You should post your ruby colored programming socks to celebrate those nice quads!
>>
>>60637789
Do you not know what a category is? The objects in the category of types are all possible types you stupid retard ass.
Again: trip on, idiot.
>>
>>60637809
God you're a fucking retard
>all possible types
Yeah because there's only one fucking system of types and it's universal and there aren't multiple exclusive type systems and even if there were one universal type system it wouldn't be totally fucking meaningless to discuss
>>
>>60637777
Well, go fuck yourself.
>>
>>60637809
>The objects in the category of types are all possible types
They're not possible types, you retard, they're most certainly and unequivocally types, no element of possibility about it.
>>
@60637827
@60637845
These completely asinine posts that reek of undergrad Dunning-Kruger don't even deserve (You)s.
>>
What was the rationale behind using the word void to mean no type and a pointer that can hold any type?
>>
>>60637686

I never said that. I said returning a value was something people do all the time. Colloquially, that just means that it's common, not that it's something that literally happens in each and every function.

>>60637698

Different precedence. I think it inherits this from Perl or some shit...

http://www.virtuouscode.com/2010/08/02/using-and-and-or-in-ruby/

>>60637808

Don't have any. Only have a fuck ton of black crew socks, many of which have holes in them.

>>60637835

I will... after a shower.
>>
>>60637868
(You) missed the joke.
>>
File: prog-challenges-14.png (302KB, 1920x1080px) Image search: [Google]
prog-challenges-14.png
302KB, 1920x1080px
>>60636940
>>
>>60637886
Don't fucking reply to me ever again unless you're contributing to the thread.
>>
>>60637886
(You) didn't say /s.

If you liked it then you should've put a /s on it.
>>
File: prog-challenges-30.png (421KB, 3840x2160px) Image search: [Google]
prog-challenges-30.png
421KB, 3840x2160px
>>60636940
>>60637893
>>
>>60637872
>I never said that. I said returning a value was something people do all the time. Colloquially, that just means that it's common, not that it's something that literally happens in each and every function.
In the an earlier thread you said that all functions return a value. Hell, you were talking about C too. Don't like, dude (girl).
>>
>>60637872
I know that it's different, doesn't make it less shit. Like what's the point of having two similar 'and' like operators when you can just use one. It is on the same level of retardation as Javascript having two none types, `undefined` and `null`.
>>
>>60637917
dumb frogposter
>>
>>60637925
>Javascript having two none types, `undefined` and `null`.
lisp also has this problem
>>
File: 1441648599925.jpg (606KB, 1395x858px) Image search: [Google]
1441648599925.jpg
606KB, 1395x858px
>>60637917
OUT
U
T
WALL NOW
>>
>>60637868
>be wrong
>give up
>>
>>60637917
>>60637941
>>60637957
Stop posting the reddit frog and get the fuck out of here.
>>
>>60637957
>calls others autists
>posts frogs
>>
Friendly reminder that javascript makes a distinction between positive and negative zero.
Also, NaN, undefined, and null can all be used to describe a null value.
>>
File: nigger star.png (13KB, 621x621px) Image search: [Google]
nigger star.png
13KB, 621x621px
>>60637941
>>60637957
>>60637973
>>
>>60637957
>being an avatar fag
>complaining about autism
Aww.
>>
File: image_1.jpg (33KB, 465x449px) Image search: [Google]
image_1.jpg
33KB, 465x449px
>>60637917
>>60637941
>>60637957
>>60637973
>>
>>60637547
Wrong. Java is pass by value for primitive types (ints, doubles), and pass by reference for objects.
>>
File: images (6).jpg (5KB, 225x225px) Image search: [Google]
images (6).jpg
5KB, 225x225px
>>60638014
>pass by reference for objects
Wrong. Java is pass by value for objects, but the value passed contains a reference. The reference itself is not passed as such.
>>
>>60637932
>her language doesn't distinguish between ``known unknowns" and ``unknown unknowns"
>>
>>60638014
Brainlet detected
>>
>>60637971
>Friendly reminder that javascript makes a distinction between positive and negative zero.
Blame it on the Insane Electrical Engineers of Europe.
>>
File: images (5).jpg (7KB, 235x215px) Image search: [Google]
images (5).jpg
7KB, 235x215px
>>60638066
if you're implying null is a known unknown, you're wrong. it's a known known. it's known to be the result of a process that can produce no meaningful result
>>
>>60638032
>contains a reference
"References" in Java only exist as part of the semantics involving how objects are handled.
>>
File: images (7).jpg (31KB, 278x181px) Image search: [Google]
images (7).jpg
31KB, 278x181px
>>60638089
>anime
You're an FPfag. That's proof right there.

Fuck off with your Haskell, multiple inheritance is the great.
>>
>>60638102
>no meaningful result
Wrong. All results are meaningful to someone.
>>
>>60638123
Shut up, you stupid no I/O fag.
>>
File: BKb01vb.png (401KB, 600x696px) Image search: [Google]
BKb01vb.png
401KB, 600x696px
>>60638123
>Wrong. All results are meaningful to someone.
Wrong. The result of destroying the human race is by definition not meaningful to anyone.
>>
File: smug_youko.png (341KB, 784x549px) Image search: [Google]
smug_youko.png
341KB, 784x549px
>>60638117
Your obsession with the FPfag shows how much your power has already dwindled. Give up, I have already won.
>Fuck off with your Haskell
I don't give a fuck about Trashkell, but only wish that its GC can clean up garbage like you. Begone, thot.
>>
>>60638139
>>60638128
>implying implications
>>
File: images (8).jpg (6KB, 300x168px) Image search: [Google]
images (8).jpg
6KB, 300x168px
>>60638141
>I don't give a fuck about Trashkell
>damage controlling this hard
Fuck off Haskell writer OOP is better
>>
File: thinking_hotaru.png (372KB, 954x768px) Image search: [Google]
thinking_hotaru.png
372KB, 954x768px
>>60638163
>OOP is better
>ousting himself as a Java pajeet freshman
You don't see something this pathetic often folks.
>>
File: 4b6.jpg (13KB, 600x515px) Image search: [Google]
4b6.jpg
13KB, 600x515px
>>60638172
>>ousting himself as a Java pajeet freshman
>You don't see something this pathetic often folks.
Fuck you Java sucks. OOP is better
>>
File: download.gif (92KB, 640x571px) Image search: [Google]
download.gif
92KB, 640x571px
Frogposter signing off for the night time to sleep goodnight bye program well
>>
Threadly reminder to report and hide all avatarfags.
>>
Why doesn this compile in GNU/Linux environment.
#include<stdio.h>
void __attribute__((__stdcall__))main(){
printf("Frog");
return;
}

gcc -S frog.c

Is dcdel hardcorded for linux?
Where is the defintion of main written ?
>>
>>60638231
I already answered your question in the other thread.
>>
>>60638205
Of course. Too bad it takes a century for the jannies and mods to show up. Remember last night's shitfest?
>>
>>60637923

You know, looking though some /g/ archives, I can't seem to find a post I've made which suggests this. Are you sure you are not mistaking me for someone else?
>>
>>60638232
Where is the definition of main?
I bet main is a function define/ #defined or typedef somewhere.
How come winMain take 4 parameters and GNU/Linux main take only 2.
>>
>>60638272
main is defined by the C standard.
It's a function that a compiler would be hardcoded to treat specially.
>>
>>60638260
>he (she) actually looked
I was lying to fuck with you. And now I feel kinda bad because you're so earnest. I'm sorry.
>>
>>60638232
Also, mine is gentoo so I guess its OpenRC.
>>
>>60638283
Then it would in GNU gcc source code. I tried but didn't find any #define/typedef or function definition of main.
>>
>>60638272
It doesn't need to be declared in any sort of header file, since it's only called by the C runtime startup code. WinMain is a special function, using different startup code, and isn't defined by the C standard.
>>
>>60638319
Dude. I want to see int main defintion if you know where it is, just point what pls.
>>
>>60638312
You searched the ENTIRE source code of gcc? I'd suggest checking in glibc or another C library. It might not be included in GCC since I believe GCC also targets "freestanding platforms" that are allowed to use a different entry point.
>>
>>60638332
I am searching in /usr/src/linux now.
>>
>>60638312
>I tried but didn't find any #define/typedef or function definition of main
Why would it need a typedef or define of main?
It would be inside the code generation and/or the semantic checker, which is actually quite far removed from C source code.

http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1570.pdf
5.1.2.2.1 Program startup
>>
I feel like I remember these threads used to be about programming but that may just be a fleeting dream of the past.
>>
>>60638332
>>60638328
>>60638319
>>60638312
Somebody has to help. The answer to this is nowhere in stackoverflow, quora, codeproject or entire internet.
>>
>>60638328
Go look up what a function definition is according to the C standard. Then, come back here and post how retarded you are.
>>
I'm writing a LMC in C
Haven't programmed in a while
>>
Also, if the C startup code calls main(), how does it handle being there two valid signatures for main: int main(int, char**) and int main(void)? Does the startup code somehow "know" which version of main your program is using? Or does it in the case of an int main(void) program just push and pop argc and argv on the stack, and just doesn't care that the program never uses them?
>>
>>60638359
>Somebody has to help.
Maybe the reason no one has run into this issue is because it hasn't affected them. What are you trying to accomplish?
>>
>>60638368
It probably just gives main the arguments regardless, and you just don't use them.
>>
File: file.png (209KB, 1844x919px) Image search: [Google]
file.png
209KB, 1844x919px
Still working on that TrayMenu..

I am going to make it a customizable launcher for Windows Servers. Add a feature where you can add parts onto the menu via XML or something, and launch a powershell script. I'm gonna use it at work after it's done.
>>
>>60638376
He's trying to accomplish being more retarded than the whole of /g/. Quite an impressive objective.
>>
>>60638386
Holy shit, that is some god-awful font rendering.
The fucking 'I' and 'P' merged together.
>>
>>60638376
understand something.
>>
>>60638395
Yeah I'm gonna fix that but I don't wanna override it right now.. I think there is a simple way but I am just avoiding it. Working on functionality over aesthetic at this stage. I am building the whole thing as a library to use in future projects
>>
>>60638386
I think you mean
/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/
>>
>>60638415
That is overly complicated..
>>
>>60637154
I guess I'll try to go with FLTK.
>>
>>60638378
>>60638363
>>60638347
>>60638332
>>60638319
>>60638283
Typical pajeets in /g;Can't answer question instead brag about question being useless.
>>
Post your favorite animal and programming language. I want to see how much shit taste /dpt/ has.
>>
>>60638544
>Post your favorite animal
my peenus weenus of course haha :DDDD
>and programming language
my peenus langus of course haha :DDDD
>>
>>60638544
>favorite animal
human

>favourite programming language
undecided but probably haskell or Idris or Purescript or some strongly typed FP language
>>
>>60638544
Animal: my wife.
Language: Fortran.
>>
>>60638544
>Animal
Sloth
>Language
All.
>>
File: 1476210377759.webm (1MB, 640x360px) Image search: [Google]
1476210377759.webm
1MB, 640x360px
>>60638544
>Favorite Animal
Pic related
>Favorite language
C
>>
>>60638570
She's so fucking hot. I'm envious of you, anon.
>>
>>60638594
>All
Bullshit
>>
File: pet rat.jpg (56KB, 640x477px) Image search: [Google]
pet rat.jpg
56KB, 640x477px
>>60638544
Favorite language: SQL
>>
File: ran's_DMRG.png (1MB, 900x1440px) Image search: [Google]
ran's_DMRG.png
1MB, 900x1440px
>>60638639
Thanks anon. She's really smart too.
>>
>>60638689
You wut m8
>>
Doest Microsoft own "stdcall" calling convention?
>>
>>60638544
Owl
D
>>
>>60638708
>Any questions?
Yes, how do I learn that?
>>
>>60638231

Hrm... if I put this code on gcc.godbolt.org, it compiles, but with a warning that the stdcall attribute is ignored. Also, Linux doesn't use cdecl on modern processors, it uses the System V ABI. You aren't using 32-bit, are you?

Oh, and...

>void main
Cut this shit out.

>>60638272

WinMain is a nonstandard entry point used primarily by MSVC. If you use a real compiler like MinGW, you should not bother with it. There is only one entry point function in C, and that is main. The main function must always take either 0 or 2 arguments, and in the latter case, those arguments should be of type int and char** respectively. It should also always return int, and nothing else.

>>60638285

Eh, it's no problem.

>>60638544

I am a fan of cats and moths.
For languages, I mostly like Ruby and C++.
>>
Hello wtf!?

Do you really have to write a header file to declare all the functions from different source files?
Does C/C++ has modules?
>>
File: disappointed.jpg (100KB, 450x539px) Image search: [Google]
disappointed.jpg
100KB, 450x539px
>>60638758
Give me a 10 reasons why I should use Ruby over any other scripting language.
>>
>>60638763

>Do you really have to write a header file to declare all the functions from different source files?
Technically, you can forward declare everything in your .c file. A header just makes it easy to share everything between source files.

>Does C/C++ has modules?
No.
>>
>>60638774
Use HolyC. The only catch is having to install TempleOS or use a VM.
>>
>>60638752
You have to be enrolled in her class anon.
>>
>>60638774

Comfy for all 10 reasons.

>>60638821

Only one youkai is actually paying attention to her lectures and taking notes. Goddamn.
>>
>>60638774
reasons why someone might learn ruby:
1. they are a girl
2. they are stupid
3. they are too stupid even for a stupid language like python
4. they are gay
5. they are a tranny
6. they are a secret agent pretending to be a tranny
7. they are a girl pretending to be a boy
8. they are a girl pretending to be a boy pretending to be a secret agent pretending to be a tranny who is stupid and probably gay
9. i cant think of any more
10. don't learn ruby it is trash
>>
Should i trust ERLANG?
>>
>>60638852
ruby also has some serious weeaboo potential being jap-based. Weebs usually go along with gay/stupid/tranny but not always. Learning ruby to pick up weeb hipsters might be viable.
>>
>>60638865
but i am a weeb and hate ruby (the language not the girl)
>>
File: 1374707254344.jpg (20KB, 400x400px) Image search: [Google]
1374707254344.jpg
20KB, 400x400px
>implementing much needed memoization and testing the speedup
>>
>>60638821
B-but Reimu wouldn't like that!
>>
>>60638821
Please provide a real answer
>>
>>60638877
>Reimu
You mean my mother-in-law? She's a bitch desu don't listen to her.
>>60638883
https://link.springer.com/book/10.1007%2Fb97552
>>
>>60638852
11. They aren't retards and picking up a simple language like ruby takes an afternoon
12. They took a web development class which focused on ruby on rails
13. Function chaining is fun as hell
>>
>>60638937
>they aren't retards
>pick up a simple language

>web dev

>pretending to be FP when you're not

thanks if i could edit posts i'd add those
>>
>>60638975

You don't have to be an idiot to use or even prefer a simpler language.
>>
File: sadness.jpg (92KB, 560x555px) Image search: [Google]
sadness.jpg
92KB, 560x555px
>>60638851
How tall are you? What color hair are you? How big are your boobs and penis? I want to imagine what you look like so I can masturbate to my fantasy of touching your feminine penis.
>tfw you will never get to cuddle Ruby
>>
File: 1481426975764.png (1MB, 1520x1080px) Image search: [Google]
1481426975764.png
1MB, 1520x1080px
>>60639058
this is why i learned to love lambda
>>
You should be able to add new classes to your code without having to recompile it t b h

Recompiling should only be required for logic, not data.
>>
>>60639125

>How tall are you?
5'10"

>What color hair are you?
I'd say a reddish brown.

>How big are your boobs and penis?
I don't have boobs, and I'm not sharing my dick size.

>I want to imagine what you look like so I can masturbate to my fantasy of touching your feminine penis.
I have an unmaintained beard that comes out at least partially from my neck. It comes about as high as my mustache. Really, anything on the lower half of my face is just facial hair. My hair is shoulder length, but I have a bald spot on the top of my head.

>>tfw you will never get to cuddle Ruby
You don't want to.

>>60639177

Meh. All else considered, I prefer languages that are simple and consistent. C++ is neither of these, but at least it gives absolute power.
>>
>>60638975
>web dev
Confirmed for not having gone to school. Probably why you are arguing about which language is "best" instead of actually working.
>>
>>60639210
>I'm not sharing my dick size.
fucking dicklet lmao
>>
>>60639216

It's not that. I just don't want that shit archived.
>>
File: 1493967347358.png (140KB, 420x420px) Image search: [Google]
1493967347358.png
140KB, 420x420px
r8 the heaviest worker in my tic-tac-toe implementation.
https://pastebin.com/x9P1J0jk

>>60639177
Lain's so adorable.

>>60639257
Nobody cares. I share tons of embarrassing stories about pathetic life.
>>
>>60638139
That's fucking retarded. There is currently a group of "humans" working toward that exact goal.
And this assumes no intelligent life exists on other planets.
>>
File: 1494961733735.jpg (362KB, 1008x720px) Image search: [Google]
1494961733735.jpg
362KB, 1008x720px
>>60635941
Does anyone have a program which lists all valid programs of a language? It can't be GPL'd and it can be in any language.
>>
>>60639414
no
>>
>>60639417
Is that right?
>>
>>60639424
yup
>>
>>60637913
Roll for COBOL
>>
>>60639437
How do you mean?
>>
>>60639414
sounds like a random number generator piped into a compiler or interpreter
>>
>>60639447
most languages have too many possible valid programs
>>
File: cuddle.png (153KB, 700x599px) Image search: [Google]
cuddle.png
153KB, 700x599px
>>60639210
You sound so cute! <3 <3 xoxox
>>
>>60639546
I have a lot of memory.
>>
>>60639685
many languages have infinitely many possible programs
>>
>>60639685

Do you have a countably infinite amount?
>>
>>60639697
What's the largest possible program possible in C++ (by lines of code) before the compilation time exceeds a month on high end hardware.
>>
>>60639719
depends on the compiler
>>
>>60638937
>13. Function chaining is fun as hell
this

  return self.sub("<~", "").sub("~>", "")
.gsub("z", "!!!!!").gsub(/\s+/, "")
.scan(/.{1,5}/)
.map{|s| s.ljust(5, "u").codepoints
.map.with_index{|i, j| (i - 33)* 85 ** (4 - j)}
.reduce(&:+).to_s(2).rjust(32, '0').scan(/.{8}/)
.map{|s| s.to_i(2).chr} }.join[0..-remainder]
end
>>
>>60639719

Take the ackermann function, translate it into some compile time evaluation tool, such as constexpr or templates, then add a comment long enough to fill up your hard drive.
>>
>>60639767
There is a line when it comes to function chaining and you have crossed it
>>
>>60639697
I have enough memory for a lot of programs.
>>60639719
I don't need to generate code for all of them though. Just parsing and typechecking is enough.
>>
>>60639783
I disagree.
>>
>>60639845
/plg/ is dead
>>
>>60639845
I disagree.
>>
>>60636161
>atomic smart pointers
???
>>
>>60636011
What exactly are the features that make C++ 11 so great?
>>
>>60640057
An extra 7 ways to initialise crap.
>>
File: wat.jpg (29KB, 400x403px) Image search: [Google]
wat.jpg
29KB, 400x403px
>>60638386
>WidnowsTasker_Winforms.*
>Widnows

What the fuck?
>>
>>60640057

move semantics
lambdas
smart pointers which aren't broken
type inference for your template insanity
>>
>>60640096
>move semantics
if you write a structure in such a manner you cant just memcopy it or write a function to move it in the case it holds pointers to heap allocated memory, youre most likely just overcomplicating things

>lambdas
even more useless, partly because of the horrible syntax that just make shit harder to read - people only use them to show off how """smart""" they are

>smart pointers which aren't broken
yay a library feature

>type inference for your template insanity
not sure what that means
>>
Anyone have experience with calling external DLLs?
I have a DLL from some manufacturer. It uses JSON as parameters. They have this request tester program in which you can set params and it generates the JSON for you and also gives you the response. Problem is I can call a sort of 'get version' from the DLL no problem but when I call for specific search parameters of a product, while the program provided returns details no problem, when calling from my program it just crashes/there is a timeout.

I can't figure this out for the life of me.
>>
>>60640161
>not sure what that means
He's saying that they made the type system so disgusting, they had to implement type inference so they could hide it.
>>
>>60640166
>a dll uses json as parameters
Jesus christ how horrifying
>>
File: cat_girl.png (341KB, 500x566px) Image search: [Google]
cat_girl.png
341KB, 500x566px
Anons, why is Ruby the most comfy language?
>>
Someone redpill me on C++11 -> C++14 -> C++17 please.
I stopped paying attention, not sure if I should pay attention again yet.
>>
>>60640161
You have no idea what you're talking about, move semantics is the best thing happened to the language, smart pointers would be impossible without it, and lambdas are far from being useless.
t. actual c++ programmer
>>
>>60640200
>t. actual c++ programmer
That means we can disregard your opinion: you're clearly retarded and/or insane.
>>
>>60640208

at least he knows what the fuck he's talking about
>>
>>60640183
Yeah it is, I call the DLL method which takes in a string of JSON and it should return some stuff based on parameters in the JSON. It doesn't however and that's the problem.
For version data it doesn't require login info (which I have and which is correct since the manufacturers program takes it in fine). What I think goes on underneath is the DLL calls a database found in the directory and parses the credentials to unlock it and then extracts whatever the requester wants. I can't figure out why it doesn't want to do so from my code though.
>>
How do you think you'll be able to write the technology of tomorrow using horribly out of date software like Linux or Vim?
>>
>>60640186

it's mostly incremental minor things

cross your fingers and hope C++20 finally introduces modules
>>
>>60640234
Can't wait for STL 2.0, rewritten from scratch, based on Concepts, with ranges and shit.
>>
@60640233
You'll need to try harder than that.
>>
>>60640185

Because it was designed specifically to be comfy.
>>
File: 1468190037218.png (463KB, 1070x601px) Image search: [Google]
1468190037218.png
463KB, 1070x601px
>tfw I fell for programming as a job meme
>>
>>60640263
Why? Are you stuck doing pajeet shit and never getting challenged?
>>
>C# lecture
>It's a GUI episode
into the trash it goes
>>
>>60640263
>meme
>>>/v/
>>
>>60640096
>>60640161
What is a ``Lambdas"?
>>
>>60640690

Function objects.
auto my_lambda = [] () { std::cout << "Hello, World!"; };
my_lambda();
>>
>>60640233
boooooooo
>>
>>60640208
Someone explain "t. " meme pls :(
>>
>>60640743
t. newfaggot
>>
>>60636203
I want to cuddle with Dlang-chan.
>>
>>60640701
Why did they pick the most retarded syntax they could think of?
C has a proposal for closures in the next standard, and it's just
^{ printf("hello"); } // void return, no arguments
^(int arg){ printf("%d\n", arg); } // void return, 1 argument
^int (int arg){ return arg + 1; } // int return, 1 argument


>>60640743
It's some really stupid thing that Americans say, for some reason.
>>
>>60640774

How does variable capture work?
>>
>>60640781
They added another type qualifier: _Shared. I don't really remember the semantics or a lot of the details.
>>
File: jjjjj.jpg (52KB, 419x249px) Image search: [Google]
jjjjj.jpg
52KB, 419x249px
>>60640774
>Americans
>not Finns
>>
>>60640791

But you're certain that they're better than C++.
>>
>>60636956
Being a transwoman.
>>
>>60640807
I was just talking about the syntax.
>>
>>60640774
It's less useful without templates since it would be converted into a function pointer and won't be inlined.
>>
>>60640814

Ugly syntax was the original criticisim.
>>
>>60640743
means "regards" in finnish
>>
>>60640701
What is a ``Function objects"?
>>
File: FsgZcPQ_d.jpg (36KB, 640x330px) Image search: [Google]
FsgZcPQ_d.jpg
36KB, 640x330px
>>60640453
yea, mostly
I ended up stuck in webdev shit with no time for personal practice. Not a big deal for now, but I'm impatient and another year seems like eternity.
Should I got for academia if I don't care about money?
>>
>>60641019

An object which overloads operator(). Therefore, you can call it as if it were a function.
>>
>>60641033
What is a ``Object" though? And why would an object be a ``function"?
>>
>>60641032
>web"""dev"""
Try using >>>/g/wdg/ to discuss this. We don't care about your kind around here.
>>
What is the cringiest programming language?
>>
>>60641079
C++
>>
>>60641063
I don't do webdev and don't want to discuss it though
>>
>>60641079
any POOlang, they're all equally cringy.
>>
>>60641104
You claiming it's "webdev" and not web"""dev""" already means you're of their kind.
>>
>>60641079

any pure functional autism
>>
>>60641131
What is a ``Pure Functional" though?
>>
>It would most likely be a significant amount of rewriting to switch databases unless you specifically wrote the app to be database-agnostic (which you shouldn't do).
Oh my god /wdg/ is hilarious.
>>
>>60641152
Keep your filth away from here.
>>>/g/wdg/
>>
>>60641152
I've basically done nothing with databases or webdev garbage, but what the hell are they doing which is so database specific?
If you use SQL properly, won't it work pretty easily on every major database?
>>
>>60641172

More or less.
>>
>>60641079
All the C++-killers with GC out there, like Go, Nim, Crystal, and D.
>>
>>60641130
no, I'm just too lazy to quote it
but very well, I don't want to discuss web '''''''''''''dev''''''''''' and this current job barely makes me do anything at all, it's a waste of my time

>>60641172
it will but people are constantly looking to avoid writing SQL queries
Trying to get entity framework to work with SQLite was one of the worst experiences
>>
/dpt/ is slow today
>>
>>60641587
it's monday
we kode
>>
c++, i want to make a class that has a field that is either an array or a vector based on the constructor input, the field is only going to be accessed with operator(), best way to do this without rewriting code? Is it bad for optimization? I would prefer to not obtain optimization by templating.
>>
>>60641640

That's basically not gonna work senpai
>>
>>60641656
Wouldn't the field being a private class extended to two classes (one for array one for vector) work?
>>
>>60641695

I think you better go back to the drawing board. What are you trying to accomplish?
>>
New thread:
>>60641703
>>60641703
>>60641703
>>
>>60641711
Having a class where the user can choose to optimize for space (vector<bool>) or speed when using the constructor. I want it to be as transparent as possible.
>>
>>60639767
>.rJUST
>>
>>60641737

I guess you could do a union between a vector<bool> and a bool*.
>>
>>60641815
Allright, thanks.
Thread posts: 316
Thread images: 58


[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.