Thread: need function help, passing arguments

  1. #16
    Registered User
    Join Date
    Jul 2006
    Posts
    15
    actually, it would be ["pD3DXMtrlBuffer" + g] not pD3DXMtrlBuffer[g] in Actionscript. Tried it in C++, but it didn't like it. Oh well.

  2. #17
    Registered User Osaou's Avatar
    Join Date
    Nov 2004
    Location
    Stockholm, Sweden
    Posts
    69
    Got a link for you: http://www.cplusplus.com/doc/tutorial/introduction.html

    What you're trying to do right now is taking a PHD when you've just quit kindergarden... No offense...

  3. #18
    Registered User
    Join Date
    Jul 2006
    Posts
    15
    insulting, yes, however I'm more of a learn-as-I-go person. I've taken a C++ course in college, so I know the basics. I just have a hard time putting some of them to use. I'm slow at programming. I want to learn DirectX though. It's extremely difficult to find good tutorials online, so I am left with experimenting on my own. I bought a book that had examples on a CD. I learned what I could from it. I learned how to load an object. Loading two objects though? It didn't go over that. I could duplicate the code to load two objects in, but that's repetative when you have 100 objects to load in a video game level. So I'm trying to rewrite the code in a for loop to accomodate multiple objects. Yes, I know it's way over my head, but I'm no scripty-kiddy. I analyze every peice of code I write. This is the only way for me to learn as I see it. At least I have halfway decent ideas to solve my code. I'm trying. Dealing with hard code is the best way to learn fast I think. You learn a lot quick.

    Anyway, continuing on with the topic, I have since learned that you cannot create variables during runtime. So the way I wanted to do it will not work. The work-around is to not have different variable names with increasing numbers at the end (ie: myVar0, myVar1, etc) and try to target them with things like [myVar + g] in a FOR loop. Rather, I will create the array myVar[2] and then I can go myVar[g] to target myVar[0] and myVar[1]

    This is the route I will go.

  4. #19
    Registered User
    Join Date
    Jul 2006
    Posts
    15
    Well, I finally completed the code. It works now. I'm officially exhuasted.

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. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  3. In over my head
    By Shelnutt2 in forum C Programming
    Replies: 1
    Last Post: 07-08-2008, 06:54 PM
  4. Passing arguments to another function
    By Wiretron in forum C Programming
    Replies: 2
    Last Post: 12-24-2006, 05:57 AM
  5. passing counters between function
    By BungleSpice in forum C Programming
    Replies: 18
    Last Post: 02-21-2004, 06:16 PM