Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

From what I have read, K&R seems to be a good place to start learning programmin

ID: 644468 • Letter: F

Question

From what I have read, K&R seems to be a good place to start learning programming in general, and C programming specifically. However, I've just started the first chapter and I have a few questions. They may be extremely simple, and I apologize if that's the case (I am new, after all) -- but your helping me answer them would be very appreciated.

1) I understand the book is written to describe C languages in general. Does this mean the examples they give are just rough outlines, and that for me to attempt them myself I have to "translate" the general outline given into C++ or C# or whatever?

For example, the textbook gives this program:

#include <stdio.h>
main()
{
printf("hello, world ");
}
But I've found a program to print "Hello, world" in C#, for example is:

// A Hello World! program in C#.
using System;
namespace HelloWorld
{
    class Hello
    {
        static void Main()
        {
            Console.WriteLine("Hello World!");

            // Keep the console window open in debug mode.
            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();
        }
    }
}
And the program in C++ looks different from both the above...

So my question is: does the book expect me to be able to translate the first program (or outline, whatever it is) to a C# or C++ program -- I am using Visual Studio -- to be able to practice myself?

2) If the book does expect me to do this, do you all have any tips on how I can go about translating general C code to C# or C++.

3) This may be opinion, but which should I base my learning on (and practice coding in) -- C# or C++?

Explanation / Answer

I understand the book is written to describe C languages in general.

The book is written to teach you ANSI C, not 'C languages in general'

Does the book expect me to be able to translate the first program ... to a C# or C++ program?

No, those are different languages, and the book does not expect you to do anything with those languages. The examples are ANSI C examples.

Do you all have any tips on how I can go about ...

Which should I base my learning on (and practice coding in) -- C# or C++?

Those questions, while perfectly fine, are off-topic for this site.

Suffice it to say, if you want to learn C# or C++, you should seek out resources for those specific languages.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at drjack9650@gmail.com
Chat Now And Get Quote