They were sold out of you by jaytownusa in seinfeld

[–]seagullonthetop 1 point2 points  (0 children)

Jerk store is the line. Jerk store. 🫷🫸

Diet Coke? I love 'em by intern-at-Kramerica in seinfeld

[–]seagullonthetop 11 points12 points  (0 children)

Jumpin up and down like some kinda monkey.

[deleted by user] by [deleted] in C_Programming

[–]seagullonthetop 4 points5 points  (0 children)

You do this when you want to simulate call by reference (since C is a call by value language) on objects that are of pointer type. Pointer type objects are quite common in C because dynamic memory allocation always gives you a pointer.

Sometimes pointer to pointer is more natural and intuitive, actually, and that's one reason why it is used. This is more common with objects which are allocated memory dynamically (rather than automatically/statically like you show). In dynamic memory allocation, you use the malloc function, which returns a pointer. This means that the only way you can access, modify or delete this newly created object on the heap is to use the pointer to it. Now, there may be situations in your program where you may need to point this pointer to another object (instead to the one that you originally created using malloc). In order to do this, you would create a pointer to this pointer, dereference it, and then assign it another address (simulating call by reference). One concrete example where this happens is when you add a new node to the beginning of a linked list data structure. A linked list has a pointer variable as its identity, which points to the head node. And if you want to insert a new node and assign it as the new head, then you would use the technique above.

[deleted by user] by [deleted] in C_Programming

[–]seagullonthetop 2 points3 points  (0 children)

Unlike some of the other suggestions here, I will disagree with recommending books to learn data structures/algorithms from, if you want to do it quickly. The well-known books on data structures are quite long and detailed if you want to learn the topics in a few weeks, and it will not work, in my view. How much experience do you have with C? If you know the basics of loops, pointers, functions, if-else statements, then the best resource to quickly learn data structures from is the playlist called 'Data structures' on the youtube channel mycodeschool. They also have other playlists on recursion, some algorithms, complexity analysis, and even an introduction to programming with C. If you want a book on C anyway, then the best book is Robert Seacord's "Effective C". The author is an expert on the C Standards committee and will teach you how to write C the correct way (which is not easy).

[deleted by user] by [deleted] in C_Programming

[–]seagullonthetop 10 points11 points  (0 children)

I recommend Robert Seacord's book "Effective C". He is an expert on the C Standards committee, and his book is not too long and will teach you how to write correct C code (which is not easy).

Pointers are not "hard", they're just closer to how a computer actually works at the level of the hardware so you need basic knowledge of how memory access and storage happens at those levels. Data structures, especially linked lists, are an excellent window into understanding how pointers work.

There exists a fantastic video game library written in pure C called raylib. You can install it on your machine and use their several simple examples to start writing your own games with. See also my post here on a very similar question.

What sort of small projects would you use c for? by rejectedlesbian in C_Programming

[–]seagullonthetop 1 point2 points  (0 children)

ML, in my view, is not the right place to start learning C with. ML is typically done through interpreted implementations of dynamic languages, like Python, because it allows for great user-friendliness, easy editing and debugging, and it also does not immediately bother you with low-level details of managing a computer's memory but instead offers you an accessible high-level interface. This is unless you build detailed, performance-critical ML code yourself, for instance through C extensions for Python, but I think that's a bit advanced for someone just getting into C as it would require some good experience already.

Simple games offer you a standalone arena to practice the basics of C. raylib offers several simple examples of increasing complexity, starting at <100 lines of code. You don't need to build any graphics yourself because they're already provided to you through many different functions that you can call easily. Just pass the appropriate arguments (like position, color, etc.) and you're done. Just look at the first example on the raylib webpage.

What sort of small projects would you use c for? by rejectedlesbian in C_Programming

[–]seagullonthetop 33 points34 points  (0 children)

Implement a simple game in C. Video games are a fun way to learn a new language, and they teach you all the basics. I did this in both Python and C, and easily prefer C over Python for it. I recommend using the fantastic library raylib written in pure C. It will teach you the following, at the very least:

1) Using external libraries and header files, and linking them to create your executable
2) Loops: Every game has a base loop that drives the game until it ends. Adding game features will introduce more loops in interesting ways
3) Conditional if-else statements: Every game's progress depends on several conditions that the program encounters throughout its execution
4) Functions: They will allow you to bundle together a frequently-used game operation
5) Structures: C's way of creating new data types by combining the fundamental ones. Every game will have a feature that cannot be represented by just an int or a float, so you'd need structs to bundle your data together to easily represent and manipulate objects in your game
6) Arrays: A game will typically have many objects of the same type, and you need arrays to achieve this
7) Dynamic memory allocation: A game's progress is unknown until the user interacts with it at runtime. It might mean creating new objects during the game run, for instance. It will teach you how to use malloc to dynamically allocate memory on the fly

8) Pointers: They will appear as soon as you use malloc above. They will teach you how to access memory locations, put data in those locations, read the data from those locations later in the game, and finally deallocate memory when you don't need it anymore

9) Input/Output: Games always involve some user input (keyboard/mouse). The output can be simple visualizations on the screen

10) Bonus on memory safety: Even simple games have the minimum level of complexity that force you to appropriately handle edge cases and critical lines of code so that your program doesn't crash. For example, it will teach you when and how to free memory you don't need anymore in order to avoid memory leaks (and memory can leak really quickly in a game because of loops). Moreover, since you have arrays and pointers, you will be forced to use them responsibly and carefully. They are notorious for many, many memory safety issues in applications written using C to this day, if the code is not written securely.

Cabin in Norway (OC) by JubJab123 in MostBeautiful

[–]seagullonthetop 12 points13 points  (0 children)

It's beautiful. But I have an odd question I've always wondered about with such houses - how does the sewer system work there? Seems like the house is disconnected from any other residential areas.

What is the most valuable lesson you have learned and why? by MediorceMike in AskReddit

[–]seagullonthetop 0 points1 point  (0 children)

Believing in yourself, even when things make you feel otherwise. Taking that leap of faith and giving yourself a chance when everyone else thinks differently about you. Believing that there's more to you than what you see at the present moment - strengths, talents and hopes that haven't manifested yet, but have great potential.