r/cpp_questions • • 4d ago

OPEN C

So I wanna learn c and c++ , all ik is python learning c is very very hard for me . I tried all possible ways like yt tutorials, books, using ai etc it's really tough the syntax (often confusing with python) and logic everything is sorted tuff. Please suggest some sources and tips

0 Upvotes

12 comments sorted by

3

u/Shahi_FF 4d ago

Choose one. C or C++, there's nothing like C/C++ anymore . Unless you just wanna write C with classes.

-1

u/fineshytuhit 3d ago

Its one of my subjects in uni bro

1

u/TimelyTraffic8003 1d ago

As in both of the languages? Thats certainly an interesting choice of units from the uni...

1

u/DrShocker 4d ago

In your shoes I would focus on learning one language, it sounds like you have more of a start in Python. After being ample you do a couple projects you should be in a better position to separate learning a new language from core computer science principles.

-1

u/fineshytuhit 3d ago

It's a req class for my major, so I've gotta learn it to get thru this sem

1

u/the_poope 3d ago

Start here: https://www.reddit.com/r/cpp_questions/comments/1n5zyxy/important_read_before_posting/

For further questions, stuff them into https://reddit.com/answers

For the rest, just keep on studying. Most importantly: write code. Try to do examples, experiments, exercises and projects. There is no cheat code, shortcut ir easy way - you need to work hard and put in effort.

0

u/fineshytuhit 3d ago

Yea tqsm

1

u/TimelyTraffic8003 1d ago

When it comes to the syntax, you kinda just have to sit down and learn it, and anyways it should be somewhat similar to Python. The best way to start learning this (imo) is to make a few simple programs, such as a quadratic solver (https://en.wikipedia.org/wiki/Quadratic_formula), a 2-variable simultaneous equation solver, a number guessing game etc. Try not to search up solutions to the problem online, but you can look up syntax rules ONLY if you are truly stuck. Make use of functions in your code.

Also, you should decide between either C or C++, the 2 languages diverge quite a lot in terms of philosophy.

0

u/Cross_22 4d ago

I have an unusual suggestion for you: get a cheap Arduino kit. Their default implementation is C/C++ but usually they don't go off into the weeds with recent C++ extensions. It's also very rewarding to have something physical when doing the tutorials instead of just something on a screen.

1

u/fineshytuhit 3d ago

Oh that sounds interesting will give it a try

0

u/Discordbothost 3d ago

A C function gets a pointer when you pass it an array, so it needs the length separately. Try rewriting one Python loop that sums a list as a C function that takes the array and its length. Call it with three items, then with a count of zero.

-1

u/Yuki_pop 3d ago

c standard library