Go Back   Flash Flash Revolution > General Discussion > Technology
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
Old 01-11-2014, 05:36 PM   #1
choof
Banned
Retired StaffFFR Simfile AuthorD7 Elite KeysmasherFFR Veteran
 
Join Date: Nov 2013
Posts: 8,563
Default 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?
choof is offline   Reply With Quote
Old 01-11-2014, 05:41 PM   #2
Fission
no
Simfile JudgeFFR Simfile AuthorFFR Veteran
 
Fission's Avatar
 
Join Date: Jan 2004
Age: 33
Posts: 1,850
Default 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 at 05:45 PM..
Fission is offline   Reply With Quote
Old 01-11-2014, 05:44 PM   #3
choof
Banned
Retired StaffFFR Simfile AuthorD7 Elite KeysmasherFFR Veteran
 
Join Date: Nov 2013
Posts: 8,563
Default Re: Just started to delve into the world of C

are pointers a pretty C exclusive concept?
choof is offline   Reply With Quote
Old 01-11-2014, 05:46 PM   #4
Fission
no
Simfile JudgeFFR Simfile AuthorFFR Veteran
 
Fission's Avatar
 
Join Date: Jan 2004
Age: 33
Posts: 1,850
Default 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.
Fission is offline   Reply With Quote
Old 01-11-2014, 05:58 PM   #5
ryuyasha
Rhythm is Magic
FFR Veteran
 
ryuyasha's Avatar
 
Join Date: Feb 2005
Posts: 670
Default 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.
__________________

Quote:
Originally Posted by psychoangel691 View Post
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.

Last edited by ryuyasha; 01-11-2014 at 06:03 PM..
ryuyasha is offline   Reply With Quote
Old 01-11-2014, 07:06 PM   #6
qqwref
stepmania archaeologist
Retired StaffFFR Simfile AuthorFFR Veteran
 
qqwref's Avatar
 
Join Date: Aug 2005
Age: 34
Posts: 4,090
Default Re: Just started to delve into the world of C

Quote:
Originally Posted by choof View Post
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)
qqwref is offline   Reply With Quote
Old 01-11-2014, 07:47 PM   #7
choof
Banned
Retired StaffFFR Simfile AuthorD7 Elite KeysmasherFFR Veteran
 
Join Date: Nov 2013
Posts: 8,563
Default Re: Just started to delve into the world of C

that'll happen later, I'm still getting shit on by semicolons
choof is offline   Reply With Quote
Old 01-11-2014, 08:10 PM   #8
qqwref
stepmania archaeologist
Retired StaffFFR Simfile AuthorFFR Veteran
 
qqwref's Avatar
 
Join Date: Aug 2005
Age: 34
Posts: 4,090
Default 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)
qqwref is offline   Reply With Quote
Old 01-11-2014, 08:20 PM   #9
dAnceguy117
new hand moves = dab
FFR Simfile AuthorFFR Veteran
 
dAnceguy117's Avatar
 
Join Date: Dec 2002
Location: he/they
Age: 33
Posts: 10,094
Default 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
dAnceguy117 is offline   Reply With Quote
Old 01-11-2014, 08:26 PM   #10
Fission
no
Simfile JudgeFFR Simfile AuthorFFR Veteran
 
Fission's Avatar
 
Join Date: Jan 2004
Age: 33
Posts: 1,850
Default 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 at 08:41 PM..
Fission is offline   Reply With Quote
Old 01-11-2014, 08:59 PM   #11
choof
Banned
Retired StaffFFR Simfile AuthorD7 Elite KeysmasherFFR Veteran
 
Join Date: Nov 2013
Posts: 8,563
Default 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
choof is offline   Reply With Quote
Old 01-11-2014, 09:01 PM   #12
dAnceguy117
new hand moves = dab
FFR Simfile AuthorFFR Veteran
 
dAnceguy117's Avatar
 
Join Date: Dec 2002
Location: he/they
Age: 33
Posts: 10,094
Default 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.
dAnceguy117 is offline   Reply With Quote
Old 01-11-2014, 09:03 PM   #13
choof
Banned
Retired StaffFFR Simfile AuthorD7 Elite KeysmasherFFR Veteran
 
Join Date: Nov 2013
Posts: 8,563
Default 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
choof is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 03:12 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright FlashFlashRevolution