notes/.config/newsboat/reddit_rss/C_Programming.rss
2023-01-28 05:22:19 -08:00

1 line
No EOL
47 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="UTF-8"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/"><category term="C_Programming" label="r/C_Programming"/><updated>2023-01-28T12:47:21+00:00</updated><icon>https://www.redditstatic.com/icon.png/</icon><id>/r/C_Programming.rss</id><link rel="self" href="https://www.reddit.com/r/C_Programming.rss" type="application/atom+xml" /><link rel="alternate" href="https://www.reddit.com/r/C_Programming" type="text/html" /><subtitle>The subreddit for the C programming language</subtitle><title>C</title><entry><author><name>/u/Jinren</name><uri>https://www.reddit.com/user/Jinren</uri></author><category term="C_Programming" label="r/C_Programming"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; Latest draft with all features integrated available here: &lt;a href=&quot;https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3054.pdf&quot;&gt;https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3054.pdf&lt;/a&gt;&lt;/p&gt; &lt;hr/&gt; &lt;p&gt;The final committee meeting to discuss features for C23 is over and we now know everything that will be in the language! &lt;del&gt;A draft of the final standard will still take a while to be produced, but&lt;/del&gt; the feature list is now fixed.&lt;/p&gt; &lt;p&gt;You can see everything that was debated this week here: &lt;a href=&quot;https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3041.htm&quot;&gt;https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3041.htm&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Personally, most excited by &lt;code&gt;embed&lt;/code&gt;, enumerations with explicit underlying types, and of course the very charismatic &lt;code&gt;auto&lt;/code&gt; and &lt;code&gt;constexpr&lt;/code&gt; borrowings. The fact that trigraphs are finally dead and buried will probably please a few folks too.&lt;/p&gt; &lt;p&gt;But there&amp;#39;s lots of serious improvement in there and while not as huge an update as some hoped for, it&amp;#39;ll be worth upgrading.&lt;/p&gt; &lt;p&gt;Unlike C11 a lot of vendors and users are actually tracking this because people care about it again, which is nice to see.&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/Jinren&quot;&gt; /u/Jinren &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/w5hl80/c23_now_finalized/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/w5hl80/c23_now_finalized/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_w5hl80</id><link href="https://www.reddit.com/r/C_Programming/comments/w5hl80/c23_now_finalized/" /><updated>2022-07-22T18:25:04+00:00</updated><published>2022-07-22T18:25:04+00:00</published><title>C23 now finalized!</title></entry><entry><author><name>/u/Adventurous_Soup_653</name><uri>https://www.reddit.com/user/Adventurous_Soup_653</uri></author><category term="C_Programming" label="r/C_Programming"/><content type="html">&lt;table&gt; &lt;tr&gt;&lt;td&gt; &lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10munho/why_c_needs_a_new_type_qualifier_either_the_most/&quot;&gt; &lt;img src=&quot;https://external-preview.redd.it/W_fmfmcJuAijiyMSnS6X4Vixdnbap2vZvWJUdAzvswc.jpg?width=320&amp;amp;crop=smart&amp;amp;auto=webp&amp;amp;s=e9053f42983ca17a2411b8ce54ec694f1a56df89&quot; alt=&quot;Why C needs a new type qualifier: Either the most important thing I've ever written or a waste of months of research, design, prototyping and testing by a very sleep-deprived father of two. You get to decide! I've submitted a paper to WG14 but they only standardize established practice.&quot; title=&quot;Why C needs a new type qualifier: Either the most important thing I've ever written or a waste of months of research, design, prototyping and testing by a very sleep-deprived father of two. You get to decide! I've submitted a paper to WG14 but they only standardize established practice.&quot; /&gt; &lt;/a&gt; &lt;/td&gt;&lt;td&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/Adventurous_Soup_653&quot;&gt; /u/Adventurous_Soup_653 &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://itnext.io/why-c-needs-a-new-type-qualifier-61ad553cbe71&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10munho/why_c_needs_a_new_type_qualifier_either_the_most/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</content><id>t3_10munho</id><media:thumbnail url="https://external-preview.redd.it/W_fmfmcJuAijiyMSnS6X4Vixdnbap2vZvWJUdAzvswc.jpg?width=320&amp;crop=smart&amp;auto=webp&amp;s=e9053f42983ca17a2411b8ce54ec694f1a56df89" /><link href="https://www.reddit.com/r/C_Programming/comments/10munho/why_c_needs_a_new_type_qualifier_either_the_most/" /><updated>2023-01-27T20:08:27+00:00</updated><published>2023-01-27T20:08:27+00:00</published><title>Why C needs a new type qualifier: Either the most important thing I've ever written or a waste of months of research, design, prototyping and testing by a very sleep-deprived father of two. You get to decide! I've submitted a paper to WG14 but they only standardize established practice.</title></entry><entry><author><name>/u/MSSisodia</name><uri>https://www.reddit.com/user/MSSisodia</uri></author><category term="C_Programming" label="r/C_Programming"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;pre&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt; int main(void) { int i=10; if(i++==10) ++i ? printf(&amp;quot;1: %d, %d&amp;quot;, i, i--):printf(&amp;quot;2: %d %d&amp;quot;, i, --i); else while(1) printf(&amp;quot;loop!&amp;quot;); } &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;I am getting different results in different IDEs. And I can&amp;#39;t find this type of question on google.&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/MSSisodia&quot;&gt; /u/MSSisodia &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10n6mw8/what_do_you_think_this_programs_output_should_be/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10n6mw8/what_do_you_think_this_programs_output_should_be/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10n6mw8</id><link href="https://www.reddit.com/r/C_Programming/comments/10n6mw8/what_do_you_think_this_programs_output_should_be/" /><updated>2023-01-28T04:57:54+00:00</updated><published>2023-01-28T04:57:54+00:00</published><title>What do you think this program's output should be? And why?</title></entry><entry><author><name>/u/PsychologicalAsk6217</name><uri>https://www.reddit.com/user/PsychologicalAsk6217</uri></author><category term="C_Programming" label="r/C_Programming"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;Hey, I&amp;#39;m new to programming and I&amp;#39;m trying to learn by myself casually for the past month, I choose C because from what i&amp;#39;ve read online it builds good foundations, old school games like doom and wolfenstein were made in C, cybersecurity elements, arduino stuff, etc... Being my current objective = making a game ala tetris, breakout, snake, &amp;quot;something simple&amp;quot;. The thing is i don&amp;#39;t even know where to start, for example I&amp;#39;ve tried following youtube videos on how to make a snake game but i feel like i&amp;#39;m just copying the code and not really understanding the basic concepts of making games (like drawing the game board).&lt;/p&gt; &lt;p&gt;From what i gather these are the &amp;quot;best&amp;quot; books to learn from = &amp;quot; The C Programming Language &amp;quot; &amp;amp; &amp;quot;C Programming a Modern Approach&amp;quot;(currently reading this one, im at chapter 8), should i just focus on the book for the time being? are there any better resources? maybe more current or game project oriented? &lt;/p&gt; &lt;p&gt;Thanks&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/PsychologicalAsk6217&quot;&gt; /u/PsychologicalAsk6217 &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10mq2o5/c_newbie/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10mq2o5/c_newbie/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10mq2o5</id><link href="https://www.reddit.com/r/C_Programming/comments/10mq2o5/c_newbie/" /><updated>2023-01-27T17:08:57+00:00</updated><published>2023-01-27T17:08:57+00:00</published><title>C newbie</title></entry><entry><author><name>/u/Luquitas007</name><uri>https://www.reddit.com/user/Luquitas007</uri></author><category term="C_Programming" label="r/C_Programming"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;&lt;code&gt;MessageBox(hwnd, &amp;quot;Not found!&amp;quot;, &amp;quot;App&amp;quot;, MB_HELP|MB_ICONEXCLAMATION)&lt;/code&gt;&lt;/p&gt; &lt;p&gt;The WM_HELP message is sent and a help page is shown on the screen, but the message box remains on the screen! What could I do to close it? &lt;/p&gt; &lt;p&gt;[SOLVED]&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/Luquitas007&quot;&gt; /u/Luquitas007 &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10mz6uj/winapi_c_message_box_does_not_close_when_user/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10mz6uj/winapi_c_message_box_does_not_close_when_user/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10mz6uj</id><link href="https://www.reddit.com/r/C_Programming/comments/10mz6uj/winapi_c_message_box_does_not_close_when_user/" /><updated>2023-01-27T23:13:28+00:00</updated><published>2023-01-27T23:13:28+00:00</published><title>[WinAPI C] Message box does not close when user presses Help button.</title></entry><entry><author><name>/u/kennbr</name><uri>https://www.reddit.com/user/kennbr</uri></author><category term="C_Programming" label="r/C_Programming"/><content type="html">&amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/kennbr&quot;&gt; /u/kennbr &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://github.com/kennbr34/evpencutil&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10mx7pd/evp_enc_utility/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10mx7pd</id><link href="https://www.reddit.com/r/C_Programming/comments/10mx7pd/evp_enc_utility/" /><updated>2023-01-27T21:52:40+00:00</updated><published>2023-01-27T21:52:40+00:00</published><title>EVP Enc Utility</title></entry><entry><author><name>/u/representativesign03</name><uri>https://www.reddit.com/user/representativesign03</uri></author><category term="C_Programming" label="r/C_Programming"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;I&amp;#39;m using Xlib on Linux and I want to send a &lt;code&gt;ClientMessage&lt;/code&gt; event to the root window. &lt;a href=&quot;https://pastebin.com/raw/a8vMqcV5&quot;&gt;Here&lt;/a&gt; (compile with &lt;code&gt;-lX11&lt;/code&gt; for GCC) is a stripped back version of what I have, that demonstrates the same issue. When run, it forks and the child process sends a single event to the root window every second. The parent process is watching for all Expose events on the root window.&lt;/p&gt; &lt;p&gt;In the &lt;code&gt;send_event()&lt;/code&gt; function, the second to last argument is the event mask, and every single resource I can find online says it should be set to zero when sending a &lt;code&gt;ClientMessage&lt;/code&gt; event. However, running the program as is does not work; I found that using &lt;code&gt;ExposureMask&lt;/code&gt; as the event mask value fixes the issue, but I know this isn&amp;#39;t how it&amp;#39;s supposed to work.&lt;/p&gt; &lt;p&gt;Additionally, &lt;code&gt;ClientMessage&lt;/code&gt; events should be picked up by &lt;code&gt;XNextEvent()&lt;/code&gt; regardless of the selected input, that&amp;#39;s why I&amp;#39;ve only passed &lt;code&gt;ExposureMask&lt;/code&gt; to &lt;code&gt;XSelectInput()&lt;/code&gt;.&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/representativesign03&quot;&gt; /u/representativesign03 &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10mwag4/xlib_why_do_i_need_to_use_a_mask_when_sending_a/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10mwag4/xlib_why_do_i_need_to_use_a_mask_when_sending_a/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10mwag4</id><link href="https://www.reddit.com/r/C_Programming/comments/10mwag4/xlib_why_do_i_need_to_use_a_mask_when_sending_a/" /><updated>2023-01-27T21:15:29+00:00</updated><published>2023-01-27T21:15:29+00:00</published><title>(Xlib) Why do I need to use a mask when sending a ClientMessage event?</title></entry><entry><author><name>/u/sahilgajjar504</name><uri>https://www.reddit.com/user/sahilgajjar504</uri></author><category term="C_Programming" label="r/C_Programming"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;&amp;#x200B;&lt;/p&gt; &lt;p&gt;&lt;a href=&quot;https://reddit.com/link/10lz4jr/video/azn8hxgunfea1/player&quot;&gt;https://reddit.com/link/10lz4jr/video/azn8hxgunfea1/player&lt;/a&gt;&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/sahilgajjar504&quot;&gt; /u/sahilgajjar504 &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10lz4jr/little_ascii_animation_i_made_using_c/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10lz4jr/little_ascii_animation_i_made_using_c/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10lz4jr</id><link href="https://www.reddit.com/r/C_Programming/comments/10lz4jr/little_ascii_animation_i_made_using_c/" /><updated>2023-01-26T18:45:21+00:00</updated><published>2023-01-26T18:45:21+00:00</published><title>little ascii animation i made using c</title></entry><entry><author><name>/u/Equivalent-Fuel9252</name><uri>https://www.reddit.com/user/Equivalent-Fuel9252</uri></author><category term="C_Programming" label="r/C_Programming"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;Im learning C as a side hobby of mine but recently ive hit a roadblock. Im using w3schools to learn somewhat the basics, but when i try to solve some problems on sites like hackerrank or w3resource, im hitting a huge roadblock.. Im nowhere near fully learning how to use C, im only around loops, starting arrays soon. But the problem is, i can maybe solve 2 or 3 of the simplest questions about loops on those sites, and the rest is too hard, usually stuff i had no idea i can do. &lt;/p&gt; &lt;p&gt;What should i do? Should i switch sites? Should i first learn how to solve those problems and then go on? Or should i just quit?&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/Equivalent-Fuel9252&quot;&gt; /u/Equivalent-Fuel9252 &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10mqfgz/need_help/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10mqfgz/need_help/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10mqfgz</id><link href="https://www.reddit.com/r/C_Programming/comments/10mqfgz/need_help/" /><updated>2023-01-27T17:23:15+00:00</updated><published>2023-01-27T17:23:15+00:00</published><title>Need help</title></entry><entry><author><name>/u/iloveclang</name><uri>https://www.reddit.com/user/iloveclang</uri></author><category term="C_Programming" label="r/C_Programming"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;Hey guys!&lt;/p&gt; &lt;p&gt;I want to have a va_list, but also append some formatting. Like, for instance for an error message I want to be able to input a formatted string, but I also want to append the errormessage. Like perror with string formatting.&lt;/p&gt; &lt;p&gt;```C void print_doubly_formatted_string(const char *f, ...) { char my_string[100];&lt;/p&gt; &lt;pre&gt;&lt;code&gt;va_list a; va_start (a, f); vsnprintf (my_string, 100, f &amp;quot;%s\n&amp;quot;, a, get_error()); va_end (a); puts(my_string); &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;} ```&lt;/p&gt; &lt;p&gt;I didn&amp;#39;t try this because it will probably fail and it looks hacky. I went with like: &amp;quot;hey maybe f will be turned into a string and concatenated to the other string&amp;quot;&lt;/p&gt; &lt;p&gt;Any ideas?&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/iloveclang&quot;&gt; /u/iloveclang &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10mgozv/can_i_mix_normal_formatting_with_a_va_list/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10mgozv/can_i_mix_normal_formatting_with_a_va_list/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10mgozv</id><link href="https://www.reddit.com/r/C_Programming/comments/10mgozv/can_i_mix_normal_formatting_with_a_va_list/" /><updated>2023-01-27T09:17:38+00:00</updated><published>2023-01-27T09:17:38+00:00</published><title>Can I mix normal formatting with a va_list?</title></entry><entry><author><name>/u/RoyalChallengers</name><uri>https://www.reddit.com/user/RoyalChallengers</uri></author><category term="C_Programming" label="r/C_Programming"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;so i was experimenting with int data type and got these outputs.&lt;/p&gt; &lt;p&gt;this is my code&lt;/p&gt; &lt;pre&gt;&lt;code&gt; 1 #include &amp;lt;stdio.h&amp;gt; 2 3 int main(){ 4 5 int a, b; 6 7 printf(&amp;quot;Enter number one: &amp;quot;); 8 scanf(&amp;quot;%d&amp;quot;, &amp;amp;a); 9 10 printf(&amp;quot;Enter number two: &amp;quot;); 11 scanf(&amp;quot;%d&amp;quot;, &amp;amp;b); 12 13 int c = a + b; 14 15 printf(&amp;quot;The sum is: %d\n &amp;quot;, c); 16 17 return 0; 18 19 } &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;and these are the cases i want to know why like this happened&lt;/p&gt; &lt;pre&gt;&lt;code&gt;case 1: Enter number one: 2147483647 Enter number two: 2147483649 The sum is: 0 why is the sum 0? case 2: Enter number one: 23 Enter number two: abcd The sum is: 23 why is the sum 23? case 3: Enter number one: abcd Enter number two: The sum is: 2029497008 why is the sum that? &lt;/code&gt;&lt;/pre&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/RoyalChallengers&quot;&gt; /u/RoyalChallengers &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10mc515/why_is_the_output_like_this_in_these_cases/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10mc515/why_is_the_output_like_this_in_these_cases/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10mc515</id><link href="https://www.reddit.com/r/C_Programming/comments/10mc515/why_is_the_output_like_this_in_these_cases/" /><updated>2023-01-27T04:32:14+00:00</updated><published>2023-01-27T04:32:14+00:00</published><title>why is the output like this in these cases ?</title></entry><entry><author><name>/u/UnderstandingLast667</name><uri>https://www.reddit.com/user/UnderstandingLast667</uri></author><category term="C_Programming" label="r/C_Programming"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;Hi guys, i was trying to write this code as a solution to an exercise in a book on C pointer.&lt;/p&gt; &lt;p&gt;But a friend told me this code isn&amp;#39;t right. What should I correct?&lt;/p&gt; &lt;pre&gt;&lt;code&gt;void my_strncat(char * dest, char *src, int len) { while(*++dest) //get the last address of the string int i = 0; while(i++ &amp;lt; len &amp;amp;&amp;amp; *src) { *dest++ = *src++; //copy src to dest } *dest = &amp;#39;\0&amp;#39;; } &lt;/code&gt;&lt;/pre&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/UnderstandingLast667&quot;&gt; /u/UnderstandingLast667 &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10mlbqg/is_this_right/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10mlbqg/is_this_right/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10mlbqg</id><link href="https://www.reddit.com/r/C_Programming/comments/10mlbqg/is_this_right/" /><updated>2023-01-27T13:52:14+00:00</updated><published>2023-01-27T13:52:14+00:00</published><title>Is this right?</title></entry><entry><author><name>/u/TheBlue-Fog</name><uri>https://www.reddit.com/user/TheBlue-Fog</uri></author><category term="C_Programming" label="r/C_Programming"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;So I&amp;#39;m studying Cybersecurity at university and we had a C/C++ course, where they just threw aspects of both languages at us. And so we were talking about &lt;strong&gt;I/O functions&lt;/strong&gt;, namely those defined in &lt;strong&gt;conio.h&lt;/strong&gt;.&lt;/p&gt; &lt;p&gt;Functions like getch(), getche(), putch(), puts() etc. are all good. But my teacher also mentioned the functioned &lt;strong&gt;putche()&lt;/strong&gt;, which supposedly does the same as putch() but with echo to the console. &lt;/p&gt; &lt;p&gt;However, no compiler that I&amp;#39;ve tried so far seems to recognize &lt;strong&gt;putche()&lt;/strong&gt; as a valid function, and I can&amp;#39;t find any information about it online either.&lt;/p&gt; &lt;p&gt;Could someone give more insight into whether this is &lt;strong&gt;&lt;em&gt;an actual function defined in conio.h&lt;/em&gt;&lt;/strong&gt;?&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/TheBlue-Fog&quot;&gt; /u/TheBlue-Fog &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10m4v9v/is_putche_a_function_in_c/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10m4v9v/is_putche_a_function_in_c/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10m4v9v</id><link href="https://www.reddit.com/r/C_Programming/comments/10m4v9v/is_putche_a_function_in_c/" /><updated>2023-01-26T22:43:02+00:00</updated><published>2023-01-26T22:43:02+00:00</published><title>Is putche() a function in C?</title></entry><entry><author><name>/u/Luffykent</name><uri>https://www.reddit.com/user/Luffykent</uri></author><category term="C_Programming" label="r/C_Programming"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;How many times will SunBeam IT Park be printed in this program? &lt;/p&gt; &lt;p&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/p&gt; &lt;p&gt;int main( void ) &lt;/p&gt; &lt;p&gt;{ &lt;/p&gt; &lt;p&gt;int i = 1; &lt;/p&gt; &lt;p&gt;for ( ; i&amp;lt;1024 ; i &amp;lt;&amp;lt;= 1) &lt;/p&gt; &lt;p&gt;printf(&amp;quot;\n SunBeam IT Park&amp;quot;); &lt;/p&gt; &lt;p&gt;return 0; &lt;/p&gt; &lt;p&gt;}&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/Luffykent&quot;&gt; /u/Luffykent &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10mldxp/why_only_10/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10mldxp/why_only_10/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10mldxp</id><link href="https://www.reddit.com/r/C_Programming/comments/10mldxp/why_only_10/" /><updated>2023-01-27T13:54:53+00:00</updated><published>2023-01-27T13:54:53+00:00</published><title>why only 10?</title></entry><entry><author><name>/u/Kworker-_-</name><uri>https://www.reddit.com/user/Kworker-_-</uri></author><category term="C_Programming" label="r/C_Programming"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;I&amp;#39;m ready for down votes:0&lt;/p&gt; &lt;p&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/p&gt; &lt;p&gt;int main(){&lt;/p&gt; &lt;p&gt;char s=sizeof(long)*8;&lt;/p&gt; &lt;p&gt;char *S=&amp;quot;!!!olleH&amp;quot;;&lt;/p&gt; &lt;p&gt;long d=0;&lt;/p&gt; &lt;p&gt;while(s)d|=(long)(*S++)&amp;lt;&amp;lt;(s-=8);&lt;/p&gt; &lt;p&gt;fwrite((void*)&amp;amp;d,sizeof(char),sizeof(long),stdout);&lt;/p&gt; &lt;p&gt;}&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/Kworker-_-&quot;&gt; /u/Kworker-_- &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10ml5if/storing_strings_in_numbers/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10ml5if/storing_strings_in_numbers/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10ml5if</id><link href="https://www.reddit.com/r/C_Programming/comments/10ml5if/storing_strings_in_numbers/" /><updated>2023-01-27T13:44:30+00:00</updated><published>2023-01-27T13:44:30+00:00</published><title>Storing strings in numbers</title></entry><entry><author><name>/u/Yudiaramos</name><uri>https://www.reddit.com/user/Yudiaramos</uri></author><category term="C_Programming" label="r/C_Programming"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;I&amp;#39;m getting back to C programming and decided to try to write a code that reads a file with multiple ints inside and counts how many of them have values that range in a certain amount. But for some reason the code reads the last line twice and counts 1 more int than its supposed to. How can I fix that? I&amp;#39;ve tried changing the while to&lt;/p&gt; &lt;pre&gt;&lt;code&gt;fgets(buffer, MAX_LINELENGTH, fpointer) &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;But I didn&amp;#39;t help.&lt;/p&gt; &lt;p&gt;This is what I&amp;#39;m working with right now:&lt;/p&gt; &lt;pre&gt;&lt;code&gt;void ocorrencias(int col){ float grade1, grade2, grade3, check; int int1 = 0; int int2 = 0; int int3 = 0; int int4 = 0; FILE *fpointer; if(fpointer == NULL){ printf(&amp;quot;ERROR!&amp;quot;); } fpointer = fopen(&amp;quot;grades.csv&amp;quot;,&amp;quot;r&amp;quot;); // while(fgets(buffer, 100, fpointer) != NULL){ testing another option (didnt work) while(!feof(fpointer)){ if(col == 1){ fscanf(fpointer,&amp;quot;%f, %f, %f, %f&amp;quot;, &amp;amp;grade1, &amp;amp;grade2, &amp;amp;grade3, &amp;amp;check); //compare(grade1, int1, int2, int3, int4); if(grade1 &amp;gt;= 0 &amp;amp;&amp;amp; grade1 &amp;lt;= 2.99){ int1++; } else if(grade1 &amp;gt;= 3.00 &amp;amp;&amp;amp; grade1 &amp;lt;= 4.99){ int2++; } else if(grade1 &amp;gt;= 5.00 &amp;amp;&amp;amp; grade1 &amp;lt;= 7.99){ int3++; } else if(grade1 &amp;gt;= 8.00 &amp;amp;&amp;amp; grade1 &amp;lt;= 10.00){ int4++; } } if(col == 2){ fscanf(fpointer,&amp;quot;%f, %f, %f, %f&amp;quot;, &amp;amp;grade1, &amp;amp;grade2, &amp;amp;grade3, &amp;amp;check); compare(grade2, int1, int2, int3, int4); } if(col == 3){ fscanf(fpointer,&amp;quot;%f, %f, %f, %f&amp;quot;, &amp;amp;grade1, &amp;amp;grade2, &amp;amp;grade3, &amp;amp;check); compare(grade3, int1, int2, int3, int4); } if(col == 4){ fscanf(fpointer,&amp;quot;%f, %f, %f, %f&amp;quot;, &amp;amp;grade1, &amp;amp;grade2, &amp;amp;grade3, &amp;amp;check); compare(check, int1, int2, int3, int4); } } print(int1, int2, int3, int4); fclose(fpointer); } &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;Only did the ifs for column 1, for testing.&lt;/p&gt; &lt;p&gt;and the txt file:&lt;/p&gt; &lt;pre&gt;&lt;code&gt;2.50,3.00,3.00,0 2.50,2.50,3.00,0 3.50,4.00,5.00,0 7.50,7.00,7.50,0 3.00,5.00,5.00,0 7.50,7.50,7.50,0 6.00,6.00,5.50,0 3.00,2.50,3.00,0 8.00,9.00,9.50,0 7.00,7.50,7.50,0 &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;the output I&amp;#39;m getting is:&lt;/p&gt; &lt;pre&gt;&lt;code&gt;2 3 5 1 &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;(occurrence 1, 2, 3 and 4 respectively).&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/Yudiaramos&quot;&gt; /u/Yudiaramos &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10lumex/last_line_of_file_being_read_twice/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10lumex/last_line_of_file_being_read_twice/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10lumex</id><link href="https://www.reddit.com/r/C_Programming/comments/10lumex/last_line_of_file_being_read_twice/" /><updated>2023-01-26T15:37:48+00:00</updated><published>2023-01-26T15:37:48+00:00</published><title>Last line of file being read twice</title></entry><entry><author><name>/u/mrhungry44</name><uri>https://www.reddit.com/user/mrhungry44</uri></author><category term="C_Programming" label="r/C_Programming"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;Beginner to C (for the third time lol). Wondering how I would take the output of ls -l into a program that counts the number of files, let&amp;#39;s say count.c, using the pipe? What I mean is, for &amp;quot;ls -l | ./count.c blah blah blah&amp;quot;, how do I write count.c so that I can read and parse through ls -l as input?&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/mrhungry44&quot;&gt; /u/mrhungry44 &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10m3rl1/ls_l_as_input_using_scanf/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10m3rl1/ls_l_as_input_using_scanf/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10m3rl1</id><link href="https://www.reddit.com/r/C_Programming/comments/10m3rl1/ls_l_as_input_using_scanf/" /><updated>2023-01-26T21:57:44+00:00</updated><published>2023-01-26T21:57:44+00:00</published><title>ls -l as input using scanf?</title></entry><entry><author><name>/u/guest271314</name><uri>https://www.reddit.com/user/guest271314</uri></author><category term="C_Programming" label="r/C_Programming"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;I&amp;#39;ve been testing this &lt;a href=&quot;https://dev-notes.eu/2018/06/http-server-in-c/&quot;&gt;HTTP Server in C&lt;/a&gt; as a basic local server. When I change the file name to e.g., a JSON file &lt;/p&gt; &lt;pre&gt;&lt;code&gt;char responseData[8000]; &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;doesn&amp;#39;t work as expected when using something like&lt;/p&gt; &lt;pre&gt;&lt;code&gt;FILE* htmlData = fopen(&amp;quot;manifest.json&amp;quot;, &amp;quot;r&amp;quot;); &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;and in the browser &lt;/p&gt; &lt;pre&gt;&lt;code&gt;await (await fetch(&amp;#39;http://localhost:8001&amp;#39;)).json(); &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;What C source code or library do you use for a local server?&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/guest271314&quot;&gt; /u/guest271314 &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10m8pla/what_c_source_code_or_library_do_you_use_for_a/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10m8pla/what_c_source_code_or_library_do_you_use_for_a/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10m8pla</id><link href="https://www.reddit.com/r/C_Programming/comments/10m8pla/what_c_source_code_or_library_do_you_use_for_a/" /><updated>2023-01-27T01:39:53+00:00</updated><published>2023-01-27T01:39:53+00:00</published><title>What C source code or library do you use for a local server?</title></entry><entry><author><name>/u/goahead97</name><uri>https://www.reddit.com/user/goahead97</uri></author><category term="C_Programming" label="r/C_Programming"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;How do I include just a specific data type defined in a .h header file?&lt;/p&gt; &lt;p&gt;Thanks&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/goahead97&quot;&gt; /u/goahead97 &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10m23jv/how_do_i_include_just_a_specific_data_type/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10m23jv/how_do_i_include_just_a_specific_data_type/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10m23jv</id><link href="https://www.reddit.com/r/C_Programming/comments/10m23jv/how_do_i_include_just_a_specific_data_type/" /><updated>2023-01-26T20:49:25+00:00</updated><published>2023-01-26T20:49:25+00:00</published><title>How do I include just a specific data type defined in a .h header file?</title></entry><entry><author><name>/u/Sirriddles</name><uri>https://www.reddit.com/user/Sirriddles</uri></author><category term="C_Programming" label="r/C_Programming"/><content type="html">&lt;table&gt; &lt;tr&gt;&lt;td&gt; &lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10lgwfm/i_made_a_simple_snake_game_using_ncurses/&quot;&gt; &lt;img src=&quot;https://external-preview.redd.it/PY2gfTjcdFmv1IREF6LT6iUktHJDchjrneic9ZkTmwQ.jpg?width=640&amp;amp;crop=smart&amp;amp;auto=webp&amp;amp;s=e98e7f4d64a142cbed1be67b44b6428c21e19b33&quot; alt=&quot;I made a simple Snake game using ncurses&quot; title=&quot;I made a simple Snake game using ncurses&quot; /&gt; &lt;/a&gt; &lt;/td&gt;&lt;td&gt; &lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;A few weeks ago I made &lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/zwnff5/can_anyone_recommend_resources_for_building_a/&quot;&gt;this post&lt;/a&gt; asking for some help with my Snake game project in C. I got a lot of great advice, including the suggestion that I look into the ncurses library. With that, I was able to make this: &lt;/p&gt; &lt;p&gt;&amp;#x200B;&lt;/p&gt; &lt;p&gt;&lt;a href=&quot;https://reddit.com/link/10lgwfm/video/nal7w9o1paea1/player&quot;&gt;https://reddit.com/link/10lgwfm/video/nal7w9o1paea1/player&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Here&amp;#39;s a link to the code: &lt;a href=&quot;https://github.com/Sirriddles89/C_snake_game/blob/main/snake.c&quot;&gt;snake.c&lt;/a&gt;&lt;/p&gt; &lt;p&gt;It does pretty much everything a simple snake game should do; it&amp;#39;s not shown in the video but the player will also receive a &amp;quot;game over&amp;quot; if they run into their own body, and the speed of the snake slightly increases with every 5 apples eaten. &lt;/p&gt; &lt;p&gt;It&amp;#39;s the first coding project I&amp;#39;ve completed start to finish on my own (ie not as a prompt or assignment from an online course) and I&amp;#39;m pretty proud of it. That said, I&amp;#39;m sure it&amp;#39;s hideous, so if anyone cares to have a look and suggest improvements, please have at it. I probably wouldn&amp;#39;t have made it this far without the help of this subreddit, so I&amp;#39;m open to more input and advice. &lt;/p&gt; &lt;p&gt;While I&amp;#39;m here I might as well ask a few questions:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;How egregious is my use of global variables here? I&amp;#39;ve heard before that it&amp;#39;s common to use globals when developing games, and I&amp;#39;ve also heard that global variables are a scourge upon humanity. Would it be good practice to rewrite my code to implement more pointers and fewer globals?&lt;/li&gt; &lt;li&gt;And now for a total noob question: how do I debug and/or run valgrind on an interactive program like this? I&amp;#39;m like 95% certain my program here isn&amp;#39;t leaking memory, but Valgrind doesn&amp;#39;t know how many snake pieces I&amp;#39;m going to end up with. And how I can I debug a program in a terminal when my terminal is running the game? Again, I know this is probably a noob question but I thought I&amp;#39;d toss it out there.&lt;/li&gt; &lt;/ol&gt; &lt;p&gt;Anyway, thanks in advance for any feedback.&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/Sirriddles&quot;&gt; /u/Sirriddles &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10lgwfm/i_made_a_simple_snake_game_using_ncurses/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10lgwfm/i_made_a_simple_snake_game_using_ncurses/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</content><id>t3_10lgwfm</id><media:thumbnail url="https://external-preview.redd.it/PY2gfTjcdFmv1IREF6LT6iUktHJDchjrneic9ZkTmwQ.jpg?width=640&amp;crop=smart&amp;auto=webp&amp;s=e98e7f4d64a142cbed1be67b44b6428c21e19b33" /><link href="https://www.reddit.com/r/C_Programming/comments/10lgwfm/i_made_a_simple_snake_game_using_ncurses/" /><updated>2023-01-26T02:20:26+00:00</updated><published>2023-01-26T02:20:26+00:00</published><title>I made a simple Snake game using ncurses</title></entry><entry><author><name>/u/Peterson_1979</name><uri>https://www.reddit.com/user/Peterson_1979</uri></author><category term="C_Programming" label="r/C_Programming"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;Is it possible to do Design patterns in C as they are usually associated with an OOP which C isnt ? If yes, are there any recommended books or courses to do so?&lt;/p&gt; &lt;p&gt;Can you recommend any textbooks or courses to learn GUI in C ?&lt;/p&gt; &lt;p&gt;Much appreciated&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/Peterson_1979&quot;&gt; /u/Peterson_1979 &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10luvaq/help_with_design_patterns_and_gui/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10luvaq/help_with_design_patterns_and_gui/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10luvaq</id><link href="https://www.reddit.com/r/C_Programming/comments/10luvaq/help_with_design_patterns_and_gui/" /><updated>2023-01-26T15:48:16+00:00</updated><published>2023-01-26T15:48:16+00:00</published><title>Help with Design Patterns and GUI</title></entry><entry><author><name>/u/Luffykent</name><uri>https://www.reddit.com/user/Luffykent</uri></author><category term="C_Programming" label="r/C_Programming"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;#include&amp;lt;stdio.h&amp;gt;&lt;br/&gt; int main( void )&lt;br/&gt; {&lt;br/&gt; int num1 = 0, num2 = -1 , num3 = -2, num4 = 1, ans;&lt;br/&gt; ans = num1++ &amp;amp;&amp;amp; num2++ || ++num4 &amp;amp;&amp;amp; num3++;&lt;br/&gt; printf(&amp;quot;%d %d %d %d %d&amp;quot;,num1, num2, num3, num4, ans);&lt;br/&gt; return 0;&lt;br/&gt; }&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/Luffykent&quot;&gt; /u/Luffykent &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10lvbva/why_num2_does_not_become_0/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10lvbva/why_num2_does_not_become_0/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10lvbva</id><link href="https://www.reddit.com/r/C_Programming/comments/10lvbva/why_num2_does_not_become_0/" /><updated>2023-01-26T16:07:19+00:00</updated><published>2023-01-26T16:07:19+00:00</published><title>Why num2 does not become 0?</title></entry><entry><author><name>/u/PlanAffectionate8157</name><uri>https://www.reddit.com/user/PlanAffectionate8157</uri></author><category term="C_Programming" label="r/C_Programming"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;Hi! Im learning programming and have a question. In the past classes we have declared global int variables and they can be accessed by any method and modified. Why would you use pointers and pass by reference when you could simply use a global variable? &lt;/p&gt; &lt;p&gt;I understand pointers help modify a specific place in memory but not so much on the value they bring.&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/PlanAffectionate8157&quot;&gt; /u/PlanAffectionate8157 &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10l33vr/the_point_of_pointers/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10l33vr/the_point_of_pointers/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10l33vr</id><link href="https://www.reddit.com/r/C_Programming/comments/10l33vr/the_point_of_pointers/" /><updated>2023-01-25T16:44:32+00:00</updated><published>2023-01-25T16:44:32+00:00</published><title>The point of Pointers?</title></entry><entry><author><name>/u/Chrinkus</name><uri>https://www.reddit.com/user/Chrinkus</uri></author><category term="C_Programming" label="r/C_Programming"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;This is one of those &amp;quot;I don&amp;#39;t know and at this point I&amp;#39;m too afraid to ask..&amp;quot; questions.&lt;/p&gt; &lt;p&gt;I read about how the golden age of game dev had engines written in C and Lua. Now I have a friend who wants to make a project using C and TypeScript and I really don&amp;#39;t know what the TypeScript is used for.&lt;/p&gt; &lt;p&gt;When I look this stuff up I see HOW to do it, most languages have some hooking mechanism for C. What I want to know is why and which parts of a project are to be scripted and which are raw, beautiful C.&lt;/p&gt; &lt;p&gt;As an ex-WoW player I understand that Lua was used to customize my UI. Is it just to provide an easier, JIT language for immediate feedback on visual elements?&lt;/p&gt; &lt;p&gt;Thanks in advance for helping me understand this.&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/Chrinkus&quot;&gt; /u/Chrinkus &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10l7o4v/what_advantage_is_there_of_mixing_a_scripting/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10l7o4v/what_advantage_is_there_of_mixing_a_scripting/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10l7o4v</id><link href="https://www.reddit.com/r/C_Programming/comments/10l7o4v/what_advantage_is_there_of_mixing_a_scripting/" /><updated>2023-01-25T19:44:11+00:00</updated><published>2023-01-25T19:44:11+00:00</published><title>What advantage is there of mixing a scripting language with C?</title></entry><entry><author><name>/u/black_dady05</name><uri>https://www.reddit.com/user/black_dady05</uri></author><category term="C_Programming" label="r/C_Programming"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;I am trying to apply the loop unrolling to find the inverse of a matrix by the Gauss Jorda method, to reduce the number of memory accesses (bottleneck) when the size of the matrices is very large and does not fit in the caches. I get it to go faster, but the result I get is wrong and I don&amp;#39;t know why. &lt;/p&gt; &lt;pre&gt;&lt;code&gt;for(k=0;k&amp;lt;size;k++) { pivot=original[k][k]; for(j=0;j&amp;lt;size;j++) { original[k][j]/=pivot; inverse[k][j]/=pivot; } for(i=0;i&amp;lt;size;i++) { if(i!=k) { pivot = original[i][k]; for(j=0;j&amp;lt;size;j++) { original[i][j] -= original[k][j]*pivot; inverse[i][j] -= inverse[k][j]*pivot; } } } } &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;I hope that the execution of the problem is faster by receiving the number of memory accesses.&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/black_dady05&quot;&gt; /u/black_dady05 &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10loorh/optimization_loop_unrolling_to_find_the_inverse/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10loorh/optimization_loop_unrolling_to_find_the_inverse/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10loorh</id><link href="https://www.reddit.com/r/C_Programming/comments/10loorh/optimization_loop_unrolling_to_find_the_inverse/" /><updated>2023-01-26T10:19:07+00:00</updated><published>2023-01-26T10:19:07+00:00</published><title>Optimization Loop unrolling to find the inverse of a matrix by the gauss jordan method</title></entry><entry><author><name>/u/Complex_Rhubarb_3411</name><uri>https://www.reddit.com/user/Complex_Rhubarb_3411</uri></author><category term="C_Programming" label="r/C_Programming"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;Take this example for instance:&lt;/p&gt; &lt;p&gt;char *str1 = &amp;quot;string Literal&amp;quot;&lt;/p&gt; &lt;p&gt;Typically, don&amp;#39;t you equate a pointer with an address not a value?&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/Complex_Rhubarb_3411&quot;&gt; /u/Complex_Rhubarb_3411 &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10lmee8/what_does_it_mean_to_equate_a_pointer_to_a/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/C_Programming/comments/10lmee8/what_does_it_mean_to_equate_a_pointer_to_a/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10lmee8</id><link href="https://www.reddit.com/r/C_Programming/comments/10lmee8/what_does_it_mean_to_equate_a_pointer_to_a/" /><updated>2023-01-26T07:29:23+00:00</updated><published>2023-01-26T07:29:23+00:00</published><title>What does it mean to equate a pointer to a character to a string?</title></entry></feed>