Just started to delve into the world of C

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • choof
    Banned
    FFR Simfile Author
    • Nov 2013
    • 8563

    #1

    Just started to delve into the world of C

    after scripting for the past 6 months or so and with a background in visual basic

    this syntax is weird as hell

    besides books, since I believe I have a few on digits, what are some good tips for someone just starting out on the language?
  • Fission
    no
    FFR Simfile Author
    • Jan 2004
    • 1850

    #2
    Re: Just started to delve into the world of C

    understand how to manipulate memory with constructs such as pointers. this is essential to understanding C and why it's useful over other languages.

    EDIT: also, the language isn't designed to stop you from doing something dumb. this is for efficiency reasons. it's really easy to shoot yourself in the foot if you aren't careful.
    Last edited by Fission; 01-11-2014, 04:45 PM.

    Comment

    • choof
      Banned
      FFR Simfile Author
      • Nov 2013
      • 8563

      #3
      Re: Just started to delve into the world of C

      are pointers a pretty C exclusive concept?

      Comment

      • Fission
        no
        FFR Simfile Author
        • Jan 2004
        • 1850

        #4
        Re: Just started to delve into the world of C

        for the most part pointer manipulation is only done in c/c++, yes. less so in c++ because of destructors.

        Comment

        • ryuyasha
          Rhythm is Magic
          • Feb 2005
          • 670

          #5
          Re: Just started to delve into the world of C

          Having studied quite a few programming languages I think I can speak on this.

          Practice practice practice. Look at similar examples, and when you get stuck on anything stackoverflow.com is your friend, as well as stackexchange.com in general, and of course, Google.

          Might also suggest to go back to slightly smaller code/programs than you are used to and build up when learning a new language.

          Both VB and C are primarily procedural languages, so at least you are in the same language family. That will simplify the learning process. Learning a (language in a) different programming language family can be confusing. I think back to when I first learned logical programming (in prolog). That was totally something else. But I digress...

          Going from VB to C I would say start by focusing on opening and closing your brackets instead of, for example, 'end while' of VB. Make sure you remember semicolons at the end of every statement, and above all remember that they are both capable of pretty much the same things, but each has its own syntax for doing so. Try to learn what the corresponding statements are, and then you will realize that just by knowing VB you are well on your way to learning C (despite the completely different syntax). I have found that the more (both programming and spoken/written) languages I learn, the easier it is to learn new ones, just by having a better understanding that they accomplish the same things (for the most part) in different ways.

          Oh, and I almost forgot cplusplus.com. C++ is a superset of C, which means everything in C is in C++. There will be C++ specific things on the site that do not apply to C, but for the most part it is an excellent C reference as well.

          And lastly ask me if you have any questions. I love C++ and C.

          Edit: and yeah, what Fission said about memory and pointers. There are safe and unsafe ways to allocate memory. C does not check if you use unsafe methods, so watch out for them.
          For example using malloc() without verifying the memory was allcated.
          Last edited by ryuyasha; 01-11-2014, 05:03 PM.

          Originally posted by psychoangel691
          No matter what tournament you play it's likely you're going to come across something you don't like or are very bad at. If you want to get into the competitive side of FFR you need to learn how to deal with and overcome these songs/charts.

          Comment

          • qqwref
            stepmania archaeologist
            FFR Simfile Author
            • Aug 2005
            • 4092

            #6
            Re: Just started to delve into the world of C

            Originally posted by choof
            are pointers a pretty C exclusive concept?
            Pointers are everywhere - they're just hidden from the programmer in most higher-level languages. Even in very high-level languages like Python, understanding how pointers work will give you a much better understanding of what actually happens when you move data around or pass variables to a function.
            Best AAA: Policy In The Sky [Oni] (81)
            Best SDG: PANTS (86)
            Best FC: Future Invasion (93)

            Comment

            • choof
              Banned
              FFR Simfile Author
              • Nov 2013
              • 8563

              #7
              Re: Just started to delve into the world of C

              that'll happen later, I'm still getting shit on by semicolons

              Comment

              • qqwref
                stepmania archaeologist
                FFR Simfile Author
                • Aug 2005
                • 4092

                #8
                Re: Just started to delve into the world of C

                Semicolons are ridiculously easy. Just put them at the end of everything (like periods in English).
                Best AAA: Policy In The Sky [Oni] (81)
                Best SDG: PANTS (86)
                Best FC: Future Invasion (93)

                Comment

                • dAnceguy117
                  new hand moves = dab
                  FFR Simfile Author
                  • Dec 2002
                  • 10097

                  #9
                  Re: Just started to delve into the world of C

                  if you want to have all of the little semicolon-type syntax stuff drilled into your head forever:
                  use notepad++ or something similar

                  if you don't care about that and just want to touch on the concepts and then maybe move on to a different language or something, which wouldn't make a ton of sense to me since you already know how to program:
                  use eclipse or something similar

                  Comment

                  • Fission
                    no
                    FFR Simfile Author
                    • Jan 2004
                    • 1850

                    #10
                    Re: Just started to delve into the world of C

                    sublime text best text editor. eclipse is pretty gross for c/c++.
                    Last edited by Fission; 01-11-2014, 07:41 PM.

                    Comment

                    • choof
                      Banned
                      FFR Simfile Author
                      • Nov 2013
                      • 8563

                      #11
                      Re: Just started to delve into the world of C

                      yeah I know semicolons are easy but I'm not totally used to them yet

                      on my linux laptop, I'm using geany for my ide
                      just got back to my desktop, I'm looking at CodeLite for ide

                      compiler I'll stick with gcc

                      Comment

                      • dAnceguy117
                        new hand moves = dab
                        FFR Simfile Author
                        • Dec 2002
                        • 10097

                        #12
                        Re: Just started to delve into the world of C

                        what I really meant to get at was, you can decide whether or not your IDE and whatnot will fix some of your mistakes for you. there are pros and cons to both.

                        Comment

                        • choof
                          Banned
                          FFR Simfile Author
                          • Nov 2013
                          • 8563

                          #13
                          Re: Just started to delve into the world of C

                          the nice thing about geany is that if I forgot a semicolon, it doesn't show up until I try to compile. perfect frustration level

                          Comment

                          Working...