attn cpp coders

in C++ -- if you call "new" to create something (like a "Class Object", raw pointer or similar) -- you will need to also call "delete" to later free the memory used by that resource.
Without laying it on too thick for johnjohn who is just starting it out. Calling "new" should be increadibly rare. As in if we are calling it, we are probably doing something wrong. There are a lot of old tutorials out there (even though in C++98 we should still be handrolling our own smart pointers since std containers are defective with std::auto_ptr). The following:

  • std::vector should contain and control lifespan of many elements (same with list/map/etc)
  • std::unique_ptr (and std::make_unique) should contain and control lifespan of one element

So really we should never be controlling the owning pointer of an object directly in C++. Whereas in C, this is the norm (and necessary).

I would go so far as to say the only valid (and exception safe) use of new is "placement new". But honestly, this stuff isn't important at this point. Like I mentioned earlier, C++ has a lot of... cruft.
 
If you’re coming from PHP, trying to navigate std::vector and std::map is going to feel like hitting a wall of "conceptual bloat." C++ makes you pick a specific "box" for your data.

If you want to keep that PHP-style flexibility without the over-engineered mess of the STL, you should honestly be looking at Lua.

In Lua, you don't need a dozen different containers. You have one: the Table. It’s a hybrid structure—it handles sequential markers and string-indexed metadata in the exact same variable.

No headers, no templates, no nonsense.

local jpeg_data = {
filename = "vacation.jpg", -- Associative
[1] = 0xFFD8 -- Sequential/Array
}


* Zero Bloat: It’s a single structure built in pure C.
* Performance: It uses a contiguous C array for the "array part" (O(1) access) and a hash table for the rest.
* FreeBSD Native: It’s already in the base system (check the loader).
> "Tables are the sole data-structuring mechanism in Lua; they can be used to represent ordinary arrays, lists, symbol tables, sets, records, graphs, trees, etc."
> — Lua 5.4 Reference Manual, Sec 2.1
>

skip the 1,000-page C++ manuals. Use C for the "bare metal" parts and Lua for the logic....

But I am also suffering the dunning-kreuger effect having known nothing about anything coding or tech-wise until mid last year.... Maybe I stuffed up going from windows to freeBSD... Hehe
 
Without laying it on too thick for johnjohn who is just starting it out. Calling "new" should be increadibly rare. As in if we are calling it, we are probably doing something wrong. There are a lot of old tutorials out there (even though in C++98 we should still be handrolling our own smart pointers since std containers are defective with std::auto_ptr).

Yes - my explanation was to help facilitate "purposeful memory management issues using C++" so that they can be observed in valgrind(1), gdb(1), etc.

You are correct that "avoiding" memory management issues in C++ in the first place is the norm :cool:

BUT programmers also need to be able to "see" memory management issues in order to learn "how to fix them" later.
 
If you want to keep that PHP-style flexibility without the over-engineered mess of the STL, you should honestly be looking at Lua.

But I am also suffering the dunning-kreuger effect having known nothing about anything coding or tech-wise until mid last year.... Maybe I stuffed up going from windows to freeBSD... Hehe
Hello orpheus497, thanks for taking time out of your day to join the discussion. I appreciate your point-of-view.

I like PHP for web development but i'm trying to learn C/C++. I only ask how to accomplish my usage of dynamic arrays using C/C++. The concept is different but i can always look at source code for ideas/guidance. I believe that PHP is written in C.

dunning-kreuger effect? seems like anyone believeing in this concept is a victim of psychological warfare. skill is not a constant. Everyone is capable of reaching higher ground but there will always be a foot trying to kick us back down.

I remember when i was unable to grasp PHP. I wanted to build a nature website. I have over one million nature photos of birds, insects, spiders, mammals, trees and flowers etc. I couldn't figure out how to build a log-in script. I joined a PHP forum full of bullies and state-sponsored psy-war soldiers. The common ideology is that i am too stupid/my skill level is too low to program PHP. The admin offered to build me a login script for 500usd. I learned how to use sessions and databases the same evening that he made his offer. I had my own login script. 8 years later and i am reading jpeg images and scanning for malware in the data. If skill level is a constant, then i should probably give up, right?
 
When learning something new, I avoid forums in most cases. When I learned C in 1987, I only had the K&R white book. The only other person who knew C was my boss who was not one I liked talking to. So I learned by doing. Making mistakes. Figuring out why I got errors and so on.

When I started my web dev business I didn't know how to program databases. So I did the same thing. Poked around till something worked. Now that I have the internet, I would Google for things I was trying to make work and experiment with those. I avoided forums as much as I could but, when I had to ask, I just ignored the bullies and others who put you down and ask questions or say things that have nothing to do with the subject at hand.

Ask simple questions. Then experiment with what you have. Small simple code to prove it works. Then see if it fits in the whole.

You might find you gather a few helpful sources. Back in the day when everything was print magazines, I used to subscribe to maybe 15 technical magazines. Over time I whittled it down three or four. Today you can whittle that down to a couple of goto places for C questions. Or, better yet, C information sources. Those that really explain how things work in simple terms.

You'll get to a point when you start realizing you know more than those on places like reddit. If you can get the answer to your simple question, just grab it and run. Pay no attention to low-life responses. They have no meaning to you and have no affect on what you're trying to do.
 
drhowarddrfine post-752259

I am happy for your success, Sir. You are very smart and i alreay know that about you. I understand and agree with your message. I have been insulted and bullied way too many times in forums. I keep negativity out of the equation as much as possible. Sometimes i break down mentally and call myself stupid whenever i struggle with a concept. I have to get away from the subject for awhile to build my confidence level up. Sometimes whenever i get away from something for awhile, i automagically understand it better when i return to the subject. The human mind is quite powerful and amazing.

I am always happy to read a success story. I hope that you continue your success story. I wish you the best for you. I learn the most from people like you. I am always happy to meet someone with such a disposition. I learn that the world is not full of bullies and that i am not alone on this side of the tracks. Your shining light is bright and i hope that others take your advice as well.
 
Ya - there is "a completely stupid" push going on right now to stop teaching new programmers how to manage computer memory correctly. So the programmers (ALSO) don't learn how to use valgrind(1) or any other memory checking tool on their finished source code/binary because: "I don't need to do that ! The software is guaranteed to be memory safe! "

I can't tell you how many times I was fixing "memory leaks" in Java code -- but I was always told "It's Java! It can't leak memory !".
Biggest leak I ever found (and one of the first) was in Java code. Turns out it was intentional, but it still got me tons of street cred at my new (at the time) job.

Yes, Valgrind is an awesome tool. Many thanks to Dr. Paul Floyd.
 
For me it was java application server. It was starving & java had no time to run garbage collection. When it was most important. DIE it said.
 
I remember when i was exploring java applets in the early 2000s. I wasn't interested in java progrmming but i use Ulead PhotoImpact image editor. I remember that a feature of version 5 could export a java applet, so i tested the applet process. I always disabled java applets in Internet Explorer and i forgot to enable java applets, yet my test PhotoImpat applet still executed in IE. I double checked that applets were disabled, then realized that i discovered a vulnerability in IE. Microsoft issued an update within 6 months.

regarding C, i have yet to explore memory management because i am fighting with strings. I understand that C produces a compiled program and strings are stored in memory. I am not stupid. But i hate that i cannot reassign a string like an integer without memory management and a literal. Also, storing a ton of strings in the program is expensive. I am trying to come up with a way to use strings in code without storing them in memory.

combination locks come to mind. I am not a lock expert, in fact, i know how to use one. If i think about a combo lock, then i wonder how does a lock work when it has no memory? how does a lock 'know' the correct combination?

So now i wonder: has anyone designed an algorithm to output strings without storing them in memory?

I have tried to come up with something and i have it working but it needs to be better. I hate the fact that i cannot 'build' a printf statement. I have to type all of the %c options and each letters index. I'd like to figure out a lock mechanism to click through the indexes using a no-stored combo. Has anyone done this before? i could use example code.

what i have so far for a combo-lock string mechanism, which works, but the printf statements are annoying.
Code:
#include <stdio.h>
#include <stdlib.h>

char ab[] = "abcdefghijklmnopqrstuvwxyz";

void char_lock(int door, int combo) {
  switch (door) {
    case 0: //position or layout of medial tiles
      switch (combo) {
        case 0: //center
          printf("%c%c%c%c%c%c\n", ab[2], ab[4], ab[13], ab[19], ab[4], ab[17]);
          break;
        case 1: //horizontal
          printf("%c%c%c%c%c%c%c%c%c%c\n", ab[7], ab[14], ab[17], ab[8], ab[25], ab[14], ab[13], ab[19], ab[0], ab[11]);
          break;
      }
      break;
    case 1:
      break;
  }
}

int main() {
  char_lock(0, 0);
  char_lock(0, 1);
  
  return 0;
}

my thought is 'why not store the alphabet and use a combo-lock mechanism to output any string without using memory'.
 
my thought is 'why not store the alphabet and use a combo-lock mechanism to output any string without using memory'.
You don't want to store strings in memory, but you want to store a chain of letters to display?

C:
printf("%c%c%c%c\n", 'H', 'e', 'l', 'l', 'o');
printf("Hello\n");

You really think the first one is better? It's not, it's bug-prone; you lose readability and maintainability.
 
so i've finally managed to come up with a functioning character generator, which doesn't need to store strings in memory and it does not muck up the compiled exuctable with plain text everywhere. I have alot to learn about this language. I had to use integer to store the codes, which means that i have to break them up with large words. Thus, it is only the beginning of this quest. Strings are a nightmare in C/C++. I truly appreciate php a bit more today. the dot concatenator is a Holy Blessing.

Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

char ab_ai[] = "abcdefghi";
char ab_jr[] = "jklmnopqr";
char ab_sz[] = "stuvwxyz";

void lock_cog(unsigned int table, unsigned int code, unsigned int newline, unsigned int continuity) {
  while (code > 0) {
      int modt = table % 10;
      int modc = code % 10;
      table = table / 10;
      code = code / 10;
      switch (modt) {
          case 1: putchar(ab_ai[modc]); break;
          case 2: putchar(ab_jr[modc]); break;
          case 3: putchar(ab_sz[modc]); break;
      }
  }
  if (newline && !continuity) { putchar('\n'); }
  return;
}
void char_lock(int door, int combo) {
  switch (door) {
    case 0: //position or layout of medial tiles
        switch (combo) {
          case 0: //center
              lock_cog(213211, 841442, 1, 0);
              break;
          case 1: //horizontal
              lock_cog(231221, 578857, 1, 1);
              lock_cog(2132, 2014, 1, 0);
              break;
        }
        break;
    case 1:
        break;
  } return;
}

int main() {

  char_lock(0, 0);
  char_lock(0, 1);

  return 0;
}

now i only see the alphabet arrays in a hex editor. Sweet.

EDIT: i have changed my code to the "Lock and Load" method, which uses numerical places to calculate positions in the single character array for alphabet. I am now happy with my "Lock and Load" character display version 1. Someday i'll see a better way to do this and i'll replace this code. For now, i'm moving on to learning pointers and memory management.

Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>

char ab[] = "abcdefghijklmnopqrstuvwxyz"; 
//a=00 b=01 c=02 d=03 e=04 f=05 g=06 h=07 i=08 j=09 k=10 l=11 m=12
//n=13 o=14 p=15 q=16 r=17 s=18 t=19 u=20 v=21 w=22 x=23 y=24 z=25

void char_load(unsigned int tens, unsigned int ones, uint8_t newline, uint8_t continuity) {
  uint8_t mt = {0}, mo = {0};
  while (ones > 0) {
      mt = tens % 10;
      mo = ones % 10;
      mo += 10 * mt;
      tens = tens / 10;
      ones = ones / 10;
      putchar(ab[mo]);
  }
  if (newline && !continuity) { putchar('\n'); }
  return;
}
void char_lock(int door, int combo) {
  switch (door) {
    case 0: //position or layout of medial tiles
        switch (combo) {
          case 0: //center
              char_load(101100, 749342, 1, 0);
              break;
          case 1: //horizontal
              char_load(120110, 458747, 1, 1);
              char_load(1011, 1093, 1, 0);
              break;
        }
        break;
    case 1:
        break;
  } return;
}

int main() {

  char_lock(0, 0);
  char_lock(0, 1);

  return 0;
}
 

Attachments

  • sourceprintf.jpg
    sourceprintf.jpg
    35.4 KB · Views: 65
  • charlock.jpg
    charlock.jpg
    158.1 KB · Views: 73
  • alphabet.jpg
    alphabet.jpg
    17.3 KB · Views: 62
I am adding closure to this thread. I have been studying alot of c lately and i know that i will need years to master this language before learning C++. Alot of members here are years ahead of me and my progression through the language depends upon the information that i can find for self-learning.

Meantime i have added a structure to my grid graph code, which i am only using as a project to begin learning C. As a side note, i didn't convert my php code properly, so the calculate center is not working correctly in my previous posts. I have corrected the data and updated my project. The problem with this particular project is that it is quite large and i cannot allow large numbers in php alone. C language is also not possible because large numbers will destroy memory quickly. A loop with 1920x1080 will create a loop of over 2 million tiles to display (i build the grid graph dynamically and display it using svg in php). I have researched embedding sql lite into a c program and i have the foundation for using a database to store the pre-calculated grid graph data. Thus, if i were to create software for this grid-graph app in C language, then i will store the data in a db instead of calculating it live. My PHP Grid Graph code calculates a ton of data: center tiles, perimeters, diagonals, tensive diagonals, neighbors NESW, right triangles contained in the graph in both directions et cetera. i created this code to answer a PHP question about breaking connections (edges/vertices) but allowing all tiles to still be accessible. So i also have a custom 'cycle/circuit breaker' algotithm in use, which also counts and stores all of the graph cycles in an array. I use arrays in PHP and this is no good in C (major memory problem.) Anyway, this graph code was just a way to begin learning C.

Code:
//cc -lm -o gg ~/gg6.c
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <math.h>
#include <stdbool.h>

struct Grid_Graph {
  unsigned int cols_m; //number of columns as m
  struct {
    bool cols_m_parity; //columns m parity bit
    unsigned int cols_m_plus_1;
    unsigned int cols_m_minus_1;
    unsigned int cols_m_minus_2;
  };
  unsigned int rows_n; //number of rows as n
  struct {
    bool rows_n_parity; //rows n parity bit
    unsigned int rows_n_plus_1;
    unsigned int rows_n_minus_1;
  };
  unsigned int spaces; //m*n as vertex spaces
} gg;

void clear_screen() {
  int system(const char *command);
  system("clear");
  return;
}

unsigned int cli_prompts(unsigned int stage, unsigned int type) {
  unsigned int passes = 0; //loop safety control

  switch (stage) {
    case 0: //get the dimensions of the grid graph
      clear_screen();
      printf("Grid Graph Dimensions (range 3-to-2000)\n");
      printf("columns: %u, rows: %u, spaces: %u\n", gg.cols_m, gg.rows_n, gg.spaces);
      printf("%s: ", type == 0 ? "Enter number of columns (m)": "Enter number of rows (n)");
      while(1) {
          if (passes > 2) {
            clear_screen();
            printf("gg: Too many attempts without a valid response.\nGoodbye.\n");
            break;
          }
          int input_status = scanf("%u", &type);
          if (input_status == 1) {
              if (type > 2 && type <= 2000) { break; }
          }
          while(getchar() != '\n');
          type = 0; passes++;
       }
    break;
  }
  return type;
}

void calculate_center() {
  unsigned int half = floor((gg.spaces + 1) / 2);
  unsigned int halves = half + 1;
  unsigned int tile1 = half - floor(half / gg.rows_n);
  unsigned int tile2 = tile1 + 1;
  unsigned int tile3 = tile1 + gg.cols_m;
  unsigned int tile4 = tile3 + 1;
  
  printf("Medial spaces\n");
  if (gg.cols_m_parity) { //warning: bool with switch.
      if (gg.rows_n_parity) {
          printf("  count: 4\n  id: %u, %u, %u, %u\n  position: stack\n", tile1, tile2, tile3, tile4);
      } else {
          printf("  count: 2\n  id here: %u, %u\n  position: horizontal\n", half, halves);
      }
  } else {
      if (gg.rows_n_parity) {
          printf("  count: 2\n  id: %u, %u\n  position: vertical\n", tile1, tile3);
      } else {
          printf("  count: 1\n  id: %u\n  position: center\n", half);
      }
  }
  return;
}

int main(void) {
    gg.cols_m = cli_prompts(0, 0); if (!gg.cols_m) { return 1; }
    gg.rows_n = cli_prompts(0, 1); if (!gg.rows_n) { return 1; }
    gg.cols_m_plus_1 = gg.cols_m + 1;
    gg.cols_m_minus_1 = gg.cols_m - 1;
    gg.cols_m_minus_2 = gg.cols_m - 2;
    gg.rows_n_plus_1 = gg.rows_n + 1;
    gg.rows_n_minus_1 = gg.rows_n - 1;

    gg.spaces = gg.cols_m * gg.rows_n;
    gg.cols_m_parity = gg.cols_m %2 ? 0: 1;
    gg.rows_n_parity = gg.rows_n %2 ? 0: 1;

    clear_screen();
    printf("columns: %u, rows: %u, spaces: %u\n", gg.cols_m, gg.rows_n, gg.spaces);
    printf("m parity: %d\nn parity: %d\n", gg.cols_m_parity, gg.rows_n_parity);
    printf("\n");
    calculate_center();

    printf("\nm+1= %u, n+1= %u\n", gg.cols_m_plus_1, gg.rows_n_plus_1);
    printf("m-1= %u, n-1= %u\n", gg.cols_m_minus_1, gg.rows_n_minus_1);
  //to test exit status from sh/bourne shell: echo $?
  return 0;
}

Since my last post, i have learned how to create a gui app using Xlib.h and i made my first window. I have also learned how to embedd sqllite directly in the C program and store the data in a file (instead of memory).

I realize how much learning is involved with this quest, so i will consider this thread closed. I have alot of class time ahead of me. However, i am going to attempt building my first Xlib GUI C program. I want to make a Wordle like game in English/German for FreeBSD.

For now, Thank you to everyone offering advice in this thread. Much appreciated. Everyone has helped me get started with C/C++ and i will remember the kindness exhibited here. I never forget those individuals that help me in my quests.
 
Hello orpheus497, thanks for taking time out of your day to join the discussion. I appreciate your point-of-view.

I like PHP for web development but i'm trying to learn C/C++. I only ask how to accomplish my usage of dynamic arrays using C/C++. The concept is different but i can always look at source code for ideas/guidance. I believe that PHP is written in C.

dunning-kreuger effect? seems like anyone believeing in this concept is a victim of psychological warfare. skill is not a constant. Everyone is capable of reaching higher ground but there will always be a foot trying to kick us back down.

I remember when i was unable to grasp PHP. I wanted to build a nature website. I have over one million nature photos of birds, insects, spiders, mammals, trees and flowers etc. I couldn't figure out how to build a log-in script. I joined a PHP forum full of bullies and state-sponsored psy-war soldiers. The common ideology is that i am too stupid/my skill level is too low to program PHP. The admin offered to build me a login script for 500usd. I learned how to use sessions and databases the same evening that he made his offer. I had my own login script. 8 years later and i am reading jpeg images and scanning for malware in the data. If skill level is a constant, then i should probably give up, right?
I appreciate the motivation my friend thank you for the kind words.

I use the term loosely just to keep myself in check and also politely state I could be wrong.

You know what they say - if you never sharpen a pencil, you're just scratching with sticks

On that - I think - I may have improved the C Shell and solved the unicode issues.

Heavy AI work so please forgive - great for learning C. tcsh was a game changer for my learning.

Working out some kinks still

 
I appreciate the motivation my friend thank you for the kind words.

I use the term loosely just to keep myself in check and also politely state I could be wrong.

You know what they say - if you never sharpen a pencil, you're just scratching with sticks

On that - I think - I may have improved the C Shell and solved the unicode issues.

Heavy AI work so please forgive - great for learning C. tcsh was a game changer for my learning.

Working out some kinks still

Hi orpheus497 thanks you for sharing info about your project. I agree that the pencil must be sharpened but i seem to need the pencil sharpener quite often :-) I'm not the sharpest pencil in the box...

Good luck with your project and i wish for you success.

I have been working on a calculator written in C99 since my last post. I am making this calculator my first C Language program. I must admit that it has been a rough road for me at times. I want to make a calculator that doesn't obey the limits of int and floating point types. I am successful but i also want to add a twist to the calculator: show the work (as one would write it out on paper.) I am finished with addition and subtraction of positive/negative numbers and i have just conquered multiplication. I have managed to cut corners to keep the memory usage small enough to utilize the stack and so far it is working well. I have devised an algorithm for division and i will be finishing up the basic arithmetic functions soon.

Mentime, i played with memory management a bit and i failed miserable the first day. LOL. I tried to use malloc for the multiplication result/product array and i ended up learning how to read system memory by screwing up the malloc. LOL. I was looking at my own user data in the console whenever my program ran. I called it a day and started over the following morning. I managed to get a grip on malloc and the new array was working smoothly. I tested it in valgrind and i am happy to say that it was successful. However, i also learned that malloc would be bad in this case because calling every time a calculation is made will result in fragmentation, so i started reading about memory pools.

I have alot to learn but my calculator is working quite well and i am calculating well beyond a googol. I have tested the code in valgrind and i am getting zero complaints from valgrind. I guess that i am grasping the concepts so far.
 
I'll be honest, you are leagues above me from what you are saying here, I am only entering the domain as a novice, I make malloc mistakes every day and this was my entry point into programming and code, my first hand coded project was a system monitor, specifically focused on thermals as BSD was my dedicated swap from windows after trying different Linuxes; I found thermal management my first quest.

oh boy did I learn a lot, and found love for BSD.

now I am doing a file manager and browser in a TUI using ncurses and holy heaven do I find myself feeling like a maroon - XD

file traversal with exit into same location in terminal along with folder renaming is so difficult and frustrating but makes me feel like I am stupid; which personally I really hate and enjoy for my own learning.

Hi orpheus497 thanks you for sharing info about your project. I agree that the pencil must be sharpened but i seem to need the pencil sharpener quite often :-) I'm not the sharpest pencil in the box...

Good luck with your project and i wish for you success.

I have been working on a calculator written in C99 since my last post. I am making this calculator my first C Language program. I must admit that it has been a rough road for me at times. I want to make a calculator that doesn't obey the limits of int and floating point types. I am successful but i also want to add a twist to the calculator: show the work (as one would write it out on paper.) I am finished with addition and subtraction of positive/negative numbers and i have just conquered multiplication. I have managed to cut corners to keep the memory usage small enough to utilize the stack and so far it is working well. I have devised an algorithm for division and i will be finishing up the basic arithmetic functions soon.

Mentime, i played with memory management a bit and i failed miserable the first day. LOL. I tried to use malloc for the multiplication result/product array and i ended up learning how to read system memory by screwing up the malloc. LOL. I was looking at my own user data in the console whenever my program ran. I called it a day and started over the following morning. I managed to get a grip on malloc and the new array was working smoothly. I tested it in valgrind and i am happy to say that it was successful. However, i also learned that malloc would be bad in this case because calling every time a calculation is made will result in fragmentation, so i started reading about memory pools.

I have alot to learn but my calculator is working quite well and i am calculating well beyond a googol. I have tested the code in valgrind and i am getting zero complaints from valgrind. I guess that i am grasping the concepts so far.
 
I'll be honest, you are leagues above me from what you are saying here, I am only entering the domain as a novice, I make malloc mistakes every day and this was my entry point into programming and code, my first hand coded project was a system monitor, specifically focused on thermals as BSD was my dedicated swap from windows after trying different Linuxes; I found thermal management my first quest.
I do not know if you are being sarcastic or complimentary. I say that because i just started learned C in March, so i cannot understand how you think that i am ahead of you. I think that you are ahead of me (working with shell code, file managers, thermal management.) I am making a calculator as my first project. I have alot to learn. I decided to learn C language first, despite the title of the thread. Once i started learning C, i became quite comfortable with it. I have not looked at Cpp yet. Which reminds me, if the plus-plus comes from programming increments then shouldn't we be thinking of C++ as D? interesting.

Anyway, i am hoping to get my calculator done as quickly as possible but good code is better than speed. I have finished comparison of numbers today so that i can indicate when numbers are greater than, less than or equal. I have tested addition, subtraction and multiplication with positive and negative numbers and comparisons and everything is working well. I have also added a user setting of international or indian number system for the presentation of numbers. I just have to finish my division algorithm and i'll have a beta product ready (console only.) I have to start learning gui design and eternalnoob suggested sdl2, so i will create an sdl2 and an x11 version.

You mentioned browser in your last post. I too wish to write a web browser someday. I'd love to replace the mainstream bloated, ai driven, data collecting government espionage browsers currently available. Even Firefox is becoming sketchy...

I used Lynx back in the Windows 98SE/XP timeframe (2000-2001?). I liked Lynx even though it is text only. My point about Lynx is that light and fast is better for a modern graphical browser but noone is writing anything decent.
 
file traversal with exit into same location in terminal along with folder renaming is so difficult and frustrating but makes me feel like I am stupid; which personally I really hate and enjoy for my own learning.
well i call myself stupid quite often and i usually realize that i am pushing myself too hard. We all need to step back from what we are doing for mental health reasons. I hate it when i start feeling negative about myself and it is the best time to take a break from coding/programming. Please remember to relax and be nice to yourself. :)
 
if the plus-plus comes from programming increments then shouldn't we be thinking of C++ as D?
That a question could start a very long discussion, since as the name already says the idea of D could be seen as to be a successor of C, since C is the successor of B. And the original intention of C++ was - when I get Stroustroup right - to improve C. (You could read the according Wikipedia pages of those languages to learn a bit about their history.)
However, there are similarities, also with Rust and other languages. Anyway since they came a very long way, and even C++ is (shall be) capable to understand "pure" C, they need to be seen as own, different languages (I hate it when people say C when they actually talk C++)
Anyway, C++, D, or Rust are already quite advanced languages, IMO not a good choice to start learning programming with.
But it seems you already figured that out yourself.

I have been studying alot of c lately and i know that i will need years to master this language before learning C++.
I decided to learn C language first, despite the title of the thread. Once i started learning C, i became quite comfortable with it. I have not looked at Cpp yet.
IMO you may not really need to master C to start with C++, but IMO it was good to have some solid C fundamentals first.
But depending on what your target is - what you're going to program, maybe "pure" C is just completely sufficient for you. And as life always is, you'll never know where a journey you once started will bring you someday.
One thing is for sure anyway:
Once you've started to learn programming, not just to pass a class but to actually program, and you program, you will learn several languages - even if you only master very few, if a language can really be mastered at all.

If I may recommend you some things, my advice was:

1. Get a copy of the K&R "The C Programming Language", second edition (1988) You can get it for a few bucks in a used book shop. I even found a PDF version of it for free download, but I don't have the link currently.
Anyway, work this book through - actually do the exercises. It will not only deliver you very solid fundamentals in C, but in programming at all. IMO very solid fundamentals you can do a lot with later, even with other languages.

2. Take the chance to learn parallel the usage of the debugger (lldb if you use clang, which I think you do) Some say, printf is all the debugging you need. Others say, a debugger is all you need. I say you need both, and will learn which to choose when.

3. If not already done yet also parallel learn a version control system. Sooner or later you will need it anyway. So better sooner, before already having a mess, and no idea how to deal with it.
 
Back
Top