Site Map - skip to main content - dyslexic font - mobile - text - print

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes Monday through Friday.


hpr1768 :: An Intro To C Episode 1 : Introduction and Types

I go through the basic types and a basic introduction of myself. :)

<< First, < Previous, Latest >>

Host Image
Hosted by cjm on 2015-05-13 is flagged as Clean and is released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. | Comments (4)

Part of the series: Programming 101

A series focusing on concepts and the basics of programming

Episode 1: History and Basic Types

Explain who you are and what you do.

  • Name: Colin Mills, (cjm)

  • Occupation: Software Engineering Student in Canada

  • I have been a UNIX geek and open source software FANATIC for about four years now.

  • Website: c-jm.github.io

Start to go into the history of C and explain where it came from.

Abstract

C was originally developed by Dennis Ritchie between 1969 and 1973 at AT&T Bell Labs,[5] and used to (re-)implement the Unix operating system.[6] It has since become one of the most widely used programming languages of all time, [7][8] with C compilers from various vendors available for the majority of existing computer architectures and operating systems. C has been standardized by the American National Standards Institute (ANSI) > since 1989 (see ANSI C) and subsequently by the International Organization for Standardization (ISO).

Explain Types and their meanings

  • SIGNED: It means it can hold either negative or positive values.

  • UNSIGNED: Unsigned means it can only hold positive values.

Retrieved From: Wikipedia On Signedness

int:

  • An int is a variable that is at leas 16 bits in size.

  • It is actually the most efficent for the processor itself.

  • Capable of storing -32767 -> 32767

Int Specifiers

  • short: 16 bits in size

    short int intThatIsAShort = 0;

  • long: 32 bits in size

    long intThatIsALong = 0;

  • long long: 64 bits in size

    long long reallyBigInteger = 0;

char

  • One byte in memory. (8 bits).

  • Holds a character but can also hold a number

    char thisCanHoldALetter = 'x'; char thisCanHoldANumber = 72;

Note about the ascii table

  • ASCII is just a number corresponding with a letter.

  • Look here for more information.

float

  • Holds floating point numbers

    float thisIsAFloat = 72.2;

Double

  • Like a float but bigger.

    double thisIsADouble = 0;

Arrays

  • Arrays are collections of multiple things

  • Have to be a set size.

  • Use braces to initalize

  • If you initalize one you initalize all.

    int arrayOfNums[100] = {0};

Strings

  • "Strings" are made up of mutliple chars. (Yes it does make sense! :))

    char arrayOfChars[81] = {0};

  • Null termination is added to the end.

    '\0'


Comments

Subscribe to the comments RSS feed.

Comment #1 posted on 2015-05-13T01:26:26Z by sigflup

Right awesome!

Right awesome, good show!

Comment #2 posted on 2015-05-14T18:22:08Z by Steve Smethurst

Thanks, and more plase

I enjoyed the show and I will continue to listen if you continue the series. I studied some C years ago, but since got diverted into Perl, JavaScript and Python. Its nice to get close again to the silicon. Many of the basics; data types and flow control etc., are common to all C-like languages. My ears will pick up when you get into C specific topics like structs, memory allocation, pointers, etc. These things I remember to be specific to C, and are what made the language exciting for me, at that time.

Comment #3 posted on 2015-05-16T01:52:34Z by Kete

I didn't think there was enough C, but I enjoyed the recording

Comment #4 posted on 2015-05-25T07:12:52Z by kdmurray

A Good Start

Thanks for the show. This was a good first look at some C basics that I haven't been exposed to since school.

I echo the call for more episodes in this series. You may yet make programmers of us all! :)

Leave Comment

Note to Verbose Commenters
If you can't fit everything you want to say in the comment below then you really should record a response show instead.

Note to Spammers
All comments are moderated. All links are checked by humans. We strip out all html. Feel free to
record a show about yourself, or your industry, or any other topic we may find interesting. We also check shows for spam :).

Provide feedback
Your Name/Handle:
Title:
Comment:
Anti Spam Question: What does the P in HPR stand for ?
Are you a spammer →
Who hosted this show →
What does HPR mean to you ?