Why the hell is C so hard? I have been trying for 2h now to read a .txt file with float values...

Why the hell is C so hard? I have been trying for 2h now to read a .txt file with float values. Still it fails and only returns zeroes instead of the real values

Attached: Capture.png (590x497, 18.46K)

Other urls found in this thread:

youtube.com/watch?v=pW-SOdj4Kkk
twitter.com/NSFWRedditGif

>using fopen instead of open
retard detected

Try printing the float by value rather than by pointer

Remove & before number array.

This
A declared array is basically a reference to the first element in it. Alternatively, numberArray+sizeof(double)*y would also work.

>C
RETARD ALERT

You'd be hard-pressed to find a well-optimized game written in anything that doesn't have critical segments written in C, retard.

OP you need to learn how to debug. It will let you step through each line of code as its running, see the stack and variables, and make it easy to see what the problem is.

Enjoy overhyping the next big niggerscript framework that will come in the next nanosecond, which requires 500 MB of node_modules for a fucking hello world application.
JS and Python are bluepill languages for simpleton fags, while C actually redpills you on wtf is going on inside the hardware.

C is actually outdated as a modern hardware description
source: somebody said that once and I'm going to parrot it

>well-optimized game
nice buzz words
i don't give a shit
time and money>your memory leaking language

I fucking know how to debug, why the fuck didnt it print the memory address instead of 0?

based

Idk I only work with Java and Javascript lol.

You'd be hard-pressed to find a well-optimized game written in anything that doesn't have critical segments written in assembly, retard.
Everything else is C++

Implying there's any need for lowlevel garbage in 2020.

Implying you couldn't have avoided all your implementation troubles and still produced a faster and more optimized program in Haskell

Implying you aren't doing it all wrong.

> Implying you can't leak memory in managed languages
Yeah, because learning how to use modern smart pointers that automatically clean up for you is too hard.
Better rely on daddy garbage manager that will fill up, and clean 500 MB of shit in RAM in Minecraft every second while you're standing still and literally nothing is happening.

I love C# for writing most of my projects and business logic, but using it for a resource-intensive game is just a shitty idea.

lmao brainlet

lol retard

Use a higher level language. C#, Java, Swift, or Rust.

> any need for lowlevel in 2020
good luck trying to reverse anything, or write game hacks for easy money, you code monkey nigger

C isn't low level. Your PC is not a PDP-11.

C# is based. This is true.
I don't understand that meme language but i think it's because you closed a file or something.
>what is unity
>inb4 >unity
So assembly?

for any other faggot that seems to think there's no need for C and C++ engineers nowadays, seethe
youtube.com/watch?v=pW-SOdj4Kkk

Attached: based-daddy.png (1487x963, 639.6K)

>C# is based. This is true.
OP here: C# is my goto language also, it just works

>Jonathan Blow

Attached: 1564834928390.png (711x590, 395.2K)

Because it doesn't have RAII. Use C++.

Dude may not have designed the best games ever made, but he sure knows his technical shit and how to actually design a language. Are you even capable of comprehending a single video on his channel that's not a game trailer or let's play?

C was never a redpill on what goes on inside the hardware
all it does it make you use manual memory management
but using C is dumb when you could use C++

>jonathan blow
old_man_yells_at_cloud.png

>he sure knows how to actually design a language.
citation needed

Everything runs on C, C++, Java, and Python.
If you know at least two of those, you're set. Everything else is just bonus.

I don't spend my time listening to some bald hipster who spent years of his time to make a glorified sudoku game interspersed with highschool philosophy quotes, lmao

>Jonathan Blow is an American video game designer and programmer, who is best known as the creator of the independent video games Braid and The Witness, both of which were released to critical acclaim.
HOLY FUCKING YIKES

but C is just a subset of C++ and not a real language. Javascript is more of a programming language than C

You're not wrong, but in the big world of business and software engineering they treat it as something entirely different. I mean if you know C++ you can figure out C fairly easily from there.

Programming in a corporate setting is fuck awful. Quit while you can or else you'll probably end up killing yourself.

>I mean if you know C++ you can figure out C fairly easily from there.
Of course because saying you know C is similar to saying you know what loops are, C is such a tiny feature of C++

>Programming in a corporate setting is fuck awful.
Programming in general is boring as fuck, I'm so glad I started working with infrastructure as a service instead and networks. So much more fun to create infrastructure deployments instead of writing CRUD applications

What you're describing is equally boring and basically the same thing as writing CRUD applications

aka
> pointers and registers are too complex for me, and my monkey brain is way too excited for the next version of React, that will have an integrated function to determine if a number is odd or even
also
> The Witness was too complex for me I gave up after 10 minutes, because I could not see the puzzle from a different point of view
got it, you're a simpleton framework trendfag

t. I want to suck blow's dick

>the only defense I have is a massive strawman

haev seex

Working on bailing, hoping to get into robotics work eventually. Need to get on the ball and teach myself ROS.

Jonathan Blow fanboys are a good example for the dunning kruger effect

Attached: fingerguns.gif (200x200, 205.52K)

Jon Blow's language is shit, the only thing it offers over C++ is compile time execution, the syntax is still just as disgusting

Tell me, when is that vaporware Jai being released? It's been 6 years already.

lmao

Attached: Screenshot from 2020-03-15 12-34-17.png (564x192, 17.59K)

to be fair you can also do the samething in C, OP is just a retard

>he needs types
HAHAHA, just create everything as var

kys
no shit Sherlock

>JONATHAN BLOW IS THE GREATEST AND I WILL WRITE MY OWN ENGINE
>h-hey guys how do i read float values from a text file?
>no! you are the one that can't program! Registers! Pointers!

Attached: 1325138537925.jpg (400x505, 52.67K)

Do you software dev faggots really equate C++ with fucking assembly?
That's just sad.

I used to care about what this guy had to say till I started to follow him on twitter... He regularly launches into tirades about how high level languages are the root of all evil, new software being too slow, and engineers nowadays not knowing how powerful the computers they work on really are, etc.

Some of it makes sense, but come on, dude... Do something other than bitching about it if you supposedly care so much.

Isn't C++ and C# basically the same nowadays?

Are you implying someone who isn't a software dev knows more about programming languages

I applied for a programming job and claimed I got good knowledge. Truth is I fluked uni and dropped out of it because math and programming was too hard. have an interview next week. wat do?

I too love the language, where I have to assert every single passed variable type manually like a peasant if I don't want to debug everything at runtime like a massive faggot.

> BUT user, THERE'S TYPE HINTS
yeah, there's also comments, which are about as effective

Attached: oycp9vjg_400x400.jpg (396x396, 26.37K)

They'll likely ask you a few basic programming questions (pointers, semaphores, loops, etc) and likely give you something to code and send back.
Best sharpen up my dude.

>Do something other than bitching about it

Sorry I forgot he's working on Jai... So besides bitching about it and working on a language only like 2 people in the entire world care about, he should do something about it like, I dunno, educate people or at least point them to the right resources.

if you're not a massive faggot that sees C/Cpp std lib functions as magic boxes, chances are high you know assembly well enough too

>educate people or at least point them to the right resources.
That's assuming the things he complains about are rational, but they aren't
He's an intelligent manchild

Because your printf specifier doesn't receive correct argument(double value, but you used a reference). Remove & as i said above.

>semaphores
Imagine any developers till knowing how to properly use them

As someone who can code in C++, how do I learn C? Taking a class where I have to use it next semester.

>pointers, semaphores, loops
one of these things is not like the others

are you stupid? The memory address is still a valid double

assembly of which architecture tho?

I'm honestly not sure what you're complaining about. Types hardly even exist in Python. You don't need to declare the type of any variable. The `float` in my list comprehension is just to convert the values from string to float before putting them in the list, but I could just leave them as strings if that would make you happy.

Attached: Screenshot from 2020-03-15 12-46-52.png (565x236, 18.65K)

There's a ton of oldschool shit online that will probably help you the most.
Just drop all the OOP stuff and you're halfway there.

C is C++ but older. It doesnt have classes and instead of cout you use printf. You'll be fine.

We actually use them regularly where I work.
Yes I hate them and want them gone, but this is also a place where we literally have zero written documentation on our systems, it's all what people know and what's in the comments of the code. Sense does not seem ingrained here. And this is a large consumer company.

Da fuq

Take C++, forget everything about classes. That's like 90% of it.

>memory address
>double
It was a b8 thread all along, right?

Attached: 182234535656.jpg (251x251, 5.92K)

>Pffftt OP can't even fOpen
>Remember how you stopped trying to learn UE because Javascript fucked your brain up and you can't do anything lower than C# these days

Attached: Monkathink.jpg (300x300, 13.87K)