Declaring

This is a discussion on Declaring within the C Programming forums, part of the General Programming Boards category; Hey guys, I'm having a few problems declaring a few variables. Thing is I'm passing "vertices" as a parameter for ...

  1. #1
    C Beginner
    Join Date
    Dec 2011
    Location
    Portugal
    Posts
    187

    Declaring

    Hey guys, I'm having a few problems declaring a few variables.

    Thing is I'm passing "vertices" as a parameter for a function like this :

    Code:
    void leadj (char doc[50],int vertices)
    What happens is when reading doc, I'm able to reach the value of vertices.
    How can I declare the value I get from the doc to vertices ?

    Thanks, Dean.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,727
    Quote Originally Posted by DeanWinchester
    What happens is when reading doc, I'm able to reach the value of vertices.
    Sounds like you are just accessing the array out of bounds. The cure: don't do that.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,304
    I don't understand what you are asking. It would help if you tell us what is going wrong.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

  4. #4
    C Beginner
    Join Date
    Dec 2011
    Location
    Portugal
    Posts
    187
    I got it fixed now, thanks for helping anyway!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. error on declaring int
    By karipap in forum C Programming
    Replies: 3
    Last Post: 05-03-2009, 06:42 PM
  2. Declaring a pointer, int *ptr vs int ptr
    By thetinman in forum C++ Programming
    Replies: 2
    Last Post: 12-01-2006, 01:39 PM
  3. Declaring variables
    By Marlon in forum C++ Programming
    Replies: 6
    Last Post: 06-21-2005, 04:16 AM
  4. need help declaring an msg
    By kwm32 in forum Windows Programming
    Replies: 6
    Last Post: 03-24-2004, 01:49 PM
  5. declaring a new type
    By c programming in forum C Programming
    Replies: 2
    Last Post: 11-19-2002, 11:31 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21