954,499 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

scanf issues, at least i think thats so (basic)

#include <stdio.h>
#include <stdlib.h>
#include <conio.h>

int main()
{
    char _name[30];
    int _age;


    printf("Hello Quester\n");
    printf("What is your name ?\n");
    scanf(_name);

    printf("...and what is your age, may i enquire esquire of peril and danger ahead\n");
    scanf  (_age);
    printf ("\nYour name is ",_name, ("  \nand your age is "), _age );
    printf("Press any key to exit");
    scanf;
    return 0;
}


Hi peeps, am using codeblocks , as i cant figure out Netbeans, but cant get this to compile without errors and warnings (particularly around line 16 and the scanf which i know i analogus to printf etc and cant understand it cos i am new, and stupid i guess)
I was wondering if i am still viewing this from a pascal like angle and have just not got to grips with c syntax yet.


Thanks for reading this and i know this is super basic, but help on this will really help me to get going. thanks again
Gruffy

gruffy321
Light Poster
32 posts since Mar 2010
Reputation Points: 10
Solved Threads: 0
 

Peeps? :icon_rolleyes:

Try This and This

WaltP
Posting Sage w/ dash of thyme
Moderator
10,506 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
 

Thanks WaltP, a little help goes a long way.
:)

gruffy321
Light Poster
32 posts since Mar 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: