Thread: undeclared (first use in this function)

  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    10

    undeclared (first use in this function)

    Hi

    I am writing a function. I am not calling it yet.

    Code:
    main()
    
    {
    //stuff
    
    newfct()
    {
    int count = 0;
    
    array[count];
    
    }
    
    }
    I get an error msg count undeclared (first use in this function) when I try to use count.
    Help.
    Thanks

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    You probably have to post a compilable example, rather than some half-baked code that is obviously cut to bits with no hope of seeing what it originally looked like.

    Are you actually using the gcc feature of functions inside functions?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Mar 2009
    Posts
    10
    Sorry, I got it, I misspelled it.

    Shame on me.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Beginner Needs help in Dev-C++
    By Korrupt Lawz in forum C++ Programming
    Replies: 20
    Last Post: 09-28-2010, 01:17 AM
  2. doubt in c parser coding
    By akshara.sinha in forum C Programming
    Replies: 4
    Last Post: 12-23-2007, 01:49 PM
  3. Consumer program
    By wise_ron in forum C Programming
    Replies: 11
    Last Post: 09-27-2006, 05:21 AM
  4. Including lib in a lib
    By bibiteinfo in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 02:28 PM
  5. Glib and file manipulation
    By unixOZ in forum Linux Programming
    Replies: 1
    Last Post: 03-22-2004, 09:39 PM