If you like DNray Forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...

 

Beginner’s guide to programming in C/C++/C#: Tips & advice

Started by thistlebake1, May 08, 2023, 06:33 AM

Previous topic - Next topic

thistlebake1Topic starter

Looking for a way to start programming in C/C++/C#.
 Many newcomers struggle to find a clear answer to this question. Personally, I started programming in 7th grade with Pascal after two years of theoretical study at school. I excelled at it, even taking 1-2 places in the Olympics. However, as I progressed, I hit a wall and struggled to understand what was going on.

Eventually, I moved on to Delphi and HTML, but ultimately lost interest in programming. Now, as I prepare to enter a computer science program, I have a renewed desire to learn C/C++/C# for future iOS/OSX programming.

According to some sources, Kernighan's "Programming in C" 2nd edition is the best textbook on the subject. However, when I tried to implement the "hello, world" program, I encountered errors in MS Visual C++, C++ Builder, and CodeLite. What am I doing wrong? Should I choose a different compiler? Any advice would be appreciated.
  •  


himachaldesk

You have a choice between three distinct programming languages: C, C++, and C#. C++ can support C libraries, but C# is completely separate from both. Additionally, C++/Cli is yet another language that has no connection to C#, yet allows for the creation of managed code using C++.

When I first began programming, I installed Visual C++ 6.0 and visited http://firststeps.ru. I began with tutorials and then progressed to reading books on C++. Some notable authors include Stroustrup, Alger, and Alexandrescu. It's worth noting that Kernighan specializes in C.

If you're using Windows, consider installing Visual Studion 2013 Express instead of C++ Builder. Lastly, CodeLite is an IDE, not a compiler. Both Visual Studio and C++ Builder come with their own compilers, so start by creating console application projects.
  •  

ManiQuadraIncorp

In case you have a fondness for Delphi and an interest in learning C++, I would suggest starting with Herbert Schildt's "C++.Basic course" as it is well-written, easily comprehensible, and reader-friendly.

After you've gotten a hold on the basics of C++, consider exploring Qt, a fantastic multiplatform C++ framework that comes with an intuitive IDE, extensive dоcumentation, and is free of cost. It also offers a feature wherein you can program using the mouse, thereby making the transition from Delphi less challenging.
  •  

techtrendsit

Do you have an estimate of how long it takes to learn C++ by Kernighan? I've been stuck on chapter 1.5.4 "Counting words" for two days now, and I couldn't solve the last three tasks on my own. I hope this doesn't mean I'm losing my memory.

Unfortunately, I don't have any friends who know about C++, so I'm forced to learn it on my own. I found solutions to those three tasks online, but it didn't really help me.
  •  

TerryMcCune

Starting programming in C/C++/C# can be challenging, but with the right resources and approach, it can be a rewarding experience. Kernighan's "Programming in C" is indeed a classic textbook that many beginners find helpful. However, it's important to note that it focuses specifically on C, not C++ or C#. So if your goal is to learn C++, you might want to consider a different book tailored for that language.

When it comes to implementing the "hello, world" program, it's essential to ensure that you have set up your development environment correctly. Since you mentioned encountering errors in MS Visual C++, C++ Builder, and CodeLite, it could be worth checking if your installations and configurations are correct.

If you're struggling with a specific compiler, you can try using a different one. Many popular options are available, such as GCC (GNU Compiler Collection) for C/C++ or Microsoft Visual Studio for C#. It's worth noting that different compilers can have slight variations in their syntax and behavior, so switching to a different one may resolve your issues.

Additionally, consider seeking help from online programming communities, forums, or even local developer groups. They can provide guidance and assistance specific to the compiler or environment you're using. Often, others have encountered similar issues and may be able to offer solutions or insights.

Lastly, remember that programming requires patience and perseverance. Understanding errors and troubleshooting them is a crucial part of the learning process, so don't get discouraged. Keep practicing, experimenting, and seeking help when needed, and you'll gradually become more comfortable with programming in C/C++/C#. Good luck with your studies and future programming endeavors!

Here are a few more tips to help you in your journey of learning C/C++/C# programming:

1. Start with the basics: Understanding the fundamentals of programming is key. Make sure you have a good grasp of basic concepts like variables, data types, control structures (if-else, loops), and functions.

2. Practice regularly: Programming is a skill that improves with practice. Code regularly, even if it's small projects or exercises. The more you code, the more comfortable and proficient you will become.

3. Work on real-world projects: Applying what you learn to practical projects can enhance your understanding and make learning more engaging. Start with simple projects, like building a calculator or a tic-tac-toe game, and gradually work your way up to more complex ones.

4. Use online resources: There are numerous online tutorials, dоcumentation, and video courses available for learning C/C++/C#. Utilize resources like tutorials on websites, YouTube videos, and coding platforms to supplement your learning.

5. Join coding communities: Engaging with fellow programmers can be incredibly helpful. Join online coding communities, forums, or social media groups where you can ask questions, share ideas, and learn from others. These communities often provide valuable insights and support.

6. Experiment and debug: Programming often involves trial and error. Don't be afraid to experiment and test different approaches. When you encounter errors or bugs, use debugging tools and techniques to analyze and fix them. The ability to debug effectively is an essential skill for any programmer.

7. Keep up with new developments: Technology and programming languages constantly evolve. Stay updated with the latest developments, new features, and best practices in the C/C++/C# communities. This knowledge will help you write more efficient and modern code.
  •  

mellsea

For C/C++, I'd recommend GCC (GNU Compiler Collection) or Clang over MSVC, as they're more standard-compliant. For C#, use Visual Studio or JetBrains Rider. Here's your "Hello, World!" in each:

C: #include <stdio.h> int main() { printf("Hello, World!\n"); return 0; }
C++: #include <iostream> int main() { std::cout << "Hello, World!\n"; return 0; }
C#: using System; class Program { static void Main() { Console.WriteLine("Hello, World!"); } }
  •  


If you like DNray forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...