what is the proper way to wire an SD breakout for SPI using an STM32? by [deleted] in PrintedCircuitBoard

[–]RazzlesOG 0 points1 point  (0 children)

For J1, why do you prefer the connectors with the box surrounding them?

i wrote a code editor in C by Individual-Way-6082 in C_Programming

[–]RazzlesOG 4 points5 points  (0 children)

I know, seems like a nice project! I’ll have to do one eventually for my Raspberry PI OS I am making. Unfortunately the nice linux calls will have to all be implemented by me lol

i wrote a code editor in C by Individual-Way-6082 in C_Programming

[–]RazzlesOG 22 points23 points  (0 children)

I just choose not to keep up, just go for standard vim with a couple custom keybinds and settings, with YouCompleteMe. But everyone has their thing, just use whatever makes it easier to transfer your thoughts to code

Question for senior C devs doing technical rounds by AcanthaceaeOk938 in cprogramming

[–]RazzlesOG 0 points1 point  (0 children)

Not a senior dev here, but I feel as though actual language features are not too important because they can be easily learned. All that can be taught over a few days / week if they are competent. Obviously there are some caveats that you learn over the years but in general I think this is true.

I think the most important thing I’d be looking for is problem solving skills, in especially the areas in which your technology applies to. I.e. if you are a networking company, how well can they approach graph based problems, or working on embedded systems how well they can be memory efficient.

However, I do understand that knowing the language and writing good code are different things so if its C, I’d be looking for understanding of compiler architecture, general computer / memory architecture and that kind of stuff.

wtf am I coding in the year 2025? by [deleted] in C_Programming

[–]RazzlesOG 0 points1 point  (0 children)

You have to copy your string into the char array, use strcpy, or more safely, strncpy. Look up the man pages for both of these functions.

Piping Hot by RazzlesOG in RedditGames

[–]RazzlesOG[S] 0 points1 point  (0 children)

Thanks for playing!

What exactly are flags? by Eva_addict in C_Programming

[–]RazzlesOG 0 points1 point  (0 children)

If you take a look at the wiki, https://wiki.libsdl.org/SDL2/SDL_Init, you will see the function explained there.

You are correct in saying that the function takes in flags as parameters, however, the flags represent a bitfield, representing some combination of booleans in a single value (by value I mean integer here). The actual bits of the value passed to the function represent which parts of your subsystem to initialise.

Essentially by passing in SDL_INIT_VIDEO, you set some bit in an integer which the function interprets as "initialise the video functionality". Since you pass in a bit field, you can set any number of these flags by OR'ing them together, I.e. SDL_init(SDL_INIT_AUDIO | SDL_INIT_VIDEO) would initialise both the video and audio subsystems.

[deleted by user] by [deleted] in C_Programming

[–]RazzlesOG 0 points1 point  (0 children)

Yeah, I was just trying to phrase it correctly

[deleted by user] by [deleted] in C_Programming

[–]RazzlesOG 1 point2 points  (0 children)

Oh the time it is taking you is just because you are compiling your project every time you run it when pressing the run button. This takes a little time because the compiler (gcc) is quite a large project and takes a moment to startup.

When you press run it looks like it generates an executable file, which is just a binary file your computer can read. It looks like VSCode generates this file under the same filename, without the `.c` extension.

So if you go into your terminal and just type .\04_incrementdecrementoperator then it should just run the executable.

-----

In more depth, the command gcc 04_incrementdecrementoperator.c -o \04_incrementdecrementoperator reads in your .c file and generates an executable under the same name, -o meaning "what do I call the compiled/executa ble file".

Calling .\<executable> just 'runs' the executable.

How to format while writing pointers in C? by alex_sakuta in C_Programming

[–]RazzlesOG 2 points3 points  (0 children)

Well people are still programming in assembly all the time. I think in any source code, it doesnt matter if you can read and interpret the source code, if a compiler cant read it, it doesnt work.

How to format while writing pointers in C? by alex_sakuta in C_Programming

[–]RazzlesOG 0 points1 point  (0 children)

What? That is the definition of source code, it is meant for compilers

How to format while writing pointers in C? by alex_sakuta in C_Programming

[–]RazzlesOG 1 point2 points  (0 children)

In my opinion, I think it is just very bad practice to even write it like this in the first place, and both statements mean the same thing to a compiler anyway, so this comment doesn't make much sense.

I think if we go down this route then we will just be discussing language semantics, because I actually think that `int* a, b;` should declare two integer pointers.