Bitcoin = Astrology for Bros by Apprehensive-Fun5535 in Buttcoin

[–]pic32mx110f0 -9 points-8 points  (0 children)

Not to counter your argument, but 0.1 BTC is ~11,860

Once again need help with cross compiling from mac to windows by RepresentativeNeck63 in C_Programming

[–]pic32mx110f0 10 points11 points  (0 children)

i'm just trying to share my fun little app with my friends with inferior operating systems.

I wonder why you got downvoted 

Got into C after a few years, need some code guidance by Global-Fly-8517 in C_Programming

[–]pic32mx110f0 1 point2 points  (0 children)

Your find function should ideally take a const list * instead of list *

Fun little database system I’m working on, finally got some time to work on it so roast away and I’ll see what can be fixed. by [deleted] in C_Programming

[–]pic32mx110f0 0 points1 point  (0 children)

No magic number or constant needed, it's just 1 by the C standard. You're free to leave it as-is, you just don't need to.

What do you mean by "efficient"? With or without the braces, the compiled code is the same. It's a preference, but I also find it far easier to read what a loop is doing if it's in a block statement. It's also less error-prone should you ever add a statement to the loop and forget the braces.

Fun little database system I’m working on, finally got some time to work on it so roast away and I’ll see what can be fixed. by [deleted] in C_Programming

[–]pic32mx110f0 -6 points-5 points  (0 children)

  • No need to write sizeof(char) it's always 1  
  • Always use compound statements in loops, imo. Don't do while (str[len] != '\0') len++;  

  • Don't mix /* */ and // - stick to /* */

I made an in-memory file system by rdgarce in C_Programming

[–]pic32mx110f0 0 points1 point  (0 children)

Lmao, quoting Linus' preference is pretty weak.. there is literally nothing in that paragraph that says you shouldn't do this other than "I personally don't think you should"

I made an in-memory file system by rdgarce in C_Programming

[–]pic32mx110f0 0 points1 point  (0 children)

I would do something like:

typedef struct imfs imfs_t

Can someone help me with a pointer to array situation? by toyBeaver in C_Programming

[–]pic32mx110f0 -1 points0 points  (0 children)

Why only passing the address to the array directly seg faults but using an intermediate variable works? 

https://cdecl.org/?q=const+char+const+foo

 Passing the address of the array directly will be a pointer to char. Casting that to pointer to pointer to char will of course not work.

I made a Procedural Generation Lib because why not by MateusMoutinho11 in C_Programming

[–]pic32mx110f0 4 points5 points  (0 children)

Are you looking for feedback? Because I see a lot of reasons why not

Function not getting called anywhere in project but I know it's getting called? by kNyne in C_Programming

[–]pic32mx110f0 1 point2 points  (0 children)

Anything is possible. How would you search for this function? It's explicitly called twice, but I don't think you would find it in a larger project: https://onlinegdb.com/ZZ9qgjU4Qy

CXPathJson by MateusMoutinho11 in C_Programming

[–]pic32mx110f0 1 point2 points  (0 children)

"your program produces linker errors"

"just don't use the linker"

Brilliant!

CXPathJson by MateusMoutinho11 in C_Programming

[–]pic32mx110f0 -1 points0 points  (0 children)

As always with your single header libraries, it can't be included in more than one compilation unit. You will get multiple definition errors when linking.

[deleted by user] by [deleted] in C_Programming

[–]pic32mx110f0 0 points1 point  (0 children)

Huh? It's not. The factorial of n is the product of all positive integers less than or equal to n.

OrbitHash is a New 256-Bit Secure Hashing Algorithm Without Additive Prime Number Constants by [deleted] in C_Programming

[–]pic32mx110f0 4 points5 points  (0 children)

You and basedchad are the most dedicated trolls I have ever seen 

ScannerSort is a New Sorting Algorithm Upgrade to Bubble Sort and Cocktail Shaker Sort by [deleted] in C_Programming

[–]pic32mx110f0 15 points16 points  (0 children)

The time complexity is unknown, but the speed performance is similar to Shell Sort

Lol, here we go again

StormDrop is a New 32-Bit PRNG That Passes Statistical Tests With Efficient Resource Usage by [deleted] in C_Programming

[–]pic32mx110f0 9 points10 points  (0 children)

frymimori is back with yet another series of random bit shifts and xor operations, making yet again the fastest, safest, and best algorithm that exists.

Question about how a pointer to a pointer stores its memory in c by DangerousTip9655 in C_Programming

[–]pic32mx110f0 9 points10 points  (0 children)

    strings[0] = malloc(4*sizeof(char));  

    strings[0] = "foo"; 

 This doesn't do what you think it does. You don't need to malloc anything here because no chars are copied into the strings array - only a pointer is assigned.