Thread: A question from a newbie regarding nested function

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Aug 2010
    Location
    Dhaka, Bangladesh
    Posts
    16

    A question from a newbie regarding nested function

    Hello there,
    I’m a brand-new student in programming arena. Actually I’m a student of other discipline and I decided to learn C language. To do so I’m currently using the book “Teach yourself C – Herbert Schildt” and a compiler “Borland C++ 5.02”. I’m just following the book as directed, but while compiling the following program, the compiler gives the message “(5, 16): Call to undefined function ‘get_sqr’. I want some help from you guys and tell me where the mistake in this program is.


    #include "stdio.h"
    main()
    {
    int sqr;
    sqr = get_sqr();

    printf("square: %d", sqr);
    }

    get_sqr()
    {
    int num;

    printf("enter a number: ");
    scanf("%d", &num);
    return(num*num);
    }
    Last edited by Sharifhs; 08-09-2010 at 05:17 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling C in Visual Studio 2005
    By emanresu in forum C Programming
    Replies: 3
    Last Post: 11-16-2009, 04:25 AM
  2. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  3. Seg Fault in Compare Function
    By tytelizgal in forum C Programming
    Replies: 1
    Last Post: 10-25-2008, 03:06 PM
  4. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  5. Newbie question about pointers in function parameters.
    By sojurn in forum C++ Programming
    Replies: 14
    Last Post: 01-20-2007, 09:21 PM

Tags for this Thread