#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

Recommended Answers

All 2 Replies

Peeps? :icon_rolleyes:

Try This and This

commented: the perfect answer +1

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.