INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

New to programming and stuck already!

New to programming and stuck already!

(OP)
First off hello everybody,

Besides a very minor flirtation with Visual Basic in my early teens I have no programming experience, but have decided I would try and learn some Objective C in the hope of one day making some apps/games for the iPhone.

Like most bushy tailed bright eyed newbies I got myself a book and sat down with X-Code following it through.

However I have only just started on the most basic programs (simple math problems in the debug console) and I'm having compilation errors already, I'm asking here because I see no reference in the book to this problem and its one of the most common functions he is using so I cant just ignore the fact none of the programs will build.

Anyway I'll jot down a snippit of the code and then the error and please enlighten me so I can continue my learning!

#include <stdio.h>

int main (int argc, const char * argv[]) {
    int a;
    int b;
    int c;
    
    a = 1;
    b = 2;
    c = a + b;
    
    NSLog (@" a + b = i%", c);
    NSLog (@" a + b = i%", a + b);
    NSLog (@" a still = i%", a);
    NSLog (@" b still = i%", b);
           
    
    return 0;
}


Expected expression before "@" token is the error popping up in the compiler

So basically the program isn't building like in his examples so I really cant do anything :(

This is slightly gutting as I copy it word for word from the book and while hes riding off into the sunset im sat wondering what the heck I can do

All help is apreciated and any resources with good begginer tips etc would be great too.

Thanks in advance for any help! Hopefully get this sorted asap as I have 2 days off and would like to really get my teeth into it!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close