User Profile

Collapse

Profile Sidebar

Collapse
MrPickle
MrPickle
Last Activity: Nov 20 '10, 09:25 PM
Joined: Jul 27 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • MrPickle
    replied to i have a byte array question
    in C
    I believe the extra character you are seeing is the null terminator '\0'. This is to signify the end of the string.
    See more | Go to post

    Leave a comment:


  • MrPickle
    replied to dijkstras algorithm
    in C
    Also, dij() need to come before calldij() because calldij() is calling dij(), or you can pre-define it.
    See more | Go to post

    Leave a comment:


  • MrPickle
    replied to struct losing it's value when in a global array
    in C
    Okay, I've found the problem. It was to do with the static initialization.

    Read here: http://www.parashift.com/c++-faq-lit...html#faq-10.12
    See more | Go to post

    Leave a comment:


  • MrPickle
    replied to struct losing it's value when in a global array
    in C
    That line works fine, it returns 30 like expected, octagon_index is a global array like octagon but I understand what you're saying.

    Here's the entire relevant part:
    Code:
    //main.cpp
    #include "octagon.h"
    
    Octagon oct(Vector3(0.0f, 0.0f, -5.0f));
    
    //octagon.h
    #include <vector>
    #include "vector.h"
    
    struct Octagon
    {
    	Octagon(Vector3&
    ...
    See more | Go to post

    Leave a comment:


  • MrPickle
    replied to struct losing it's value when in a global array
    in C
    In my debugger the values are there until I call the constructor for another function but that function doesn't change the variable at all, it just reads from it. It couldn't change the values because they're defined as const, also if I output the values they're all 0, but I put that in the first for loop. Here's the function in which the values are set to 0.

    Code:
    Octagon::Octagon(Vector3& pos, Vector3& rot)
    {
    	for(int
    ...
    See more | Go to post

    Leave a comment:


  • MrPickle
    started a topic struct losing it's value when in a global array
    in C

    struct losing it's value when in a global array

    I have a struct like so defined like so:
    Code:
    //vector3.h
    struct Vector3
    {
    	float x, y, z;
    	Vector3();
    	Vector3(float _x, float _y, float _z);
    	Vector3(const Vector3 &v);
    };
    
    //vector3.cpp
    #include "vector3.h"
    
    Vector3::Vector3()
    {
    	x = y = z = 0.0f;
    }
    
    Vector3::Vector3(float _x, float _y, float _z)
    {
    ...
    See more | Go to post

  • MrPickle
    replied to cout & cin problem
    in C
    That fixed the problem, thanks (:
    See more | Go to post

    Leave a comment:


  • MrPickle
    started a topic cout & cin problem
    in C

    cout & cin problem

    I am doing the following:

    Code:
    std::string message = "";
    while(message.empty())
    {
    	std::cout << "Please enter your message: ";
    	std::getline(std::cin, message);
    }
    The std::getline(st d::cin, message) line doesn't wait for user input, it goes through the loop twice then waits so I get this:



    I don't understand why?...
    See more | Go to post

  • MrPickle
    started a topic For loops
    in C

    For loops

    When I define a for loop like so:

    Code:
    for(initialize; condition; increment)
    {
       //code
    }
    Is the condition only called once?

    For example:
    Code:
    for(unsigned int i = 0; i < foo(); i++)
    {
       //code
    }
    Would foo() be called several times, or only once?

    Sidenote: I know I could easily test this but it's bugging me and I do not currently have a compiler...
    See more | Go to post

  • MrPickle
    replied to Help me please { function }
    in C
    On line 34 and 93, you declare variables of type FILE* but you don't assign them a name.

    Code:
    void getData (FILE*,int id [],char name [max][],int test1[],int test2[],float mid[],float final[],int lab[],int*cnt)
    You also do this with the last parameter here, of type int*
    Code:
    void showResult(FILE*,int id[],char name[],float mid[],float final[],int lab[],int*);
    See more | Go to post

    Leave a comment:


  • MrPickle
    replied to Visual Studio Express on 64bit OS
    in C
    I am a student, just not in computer science yet ):

    I think I am barking up the wrong tree anyway; I had trouble running some projects that compiled perfectly fine so I thought it had something to do with me being on a 64-bit OS. I just tried a simple Hello World console application and it compiled and ran perfectly fine. I think it's to do with Win32.

    Thank you though.
    See more | Go to post

    Leave a comment:


  • MrPickle
    started a topic Visual Studio Express on 64bit OS
    in C

    Visual Studio Express on 64bit OS

    I am having trouble compiling with Visual Studio Express 2008 on Vista-64bit.

    I read that I must configure VS to compile for 64-bit but I did not have this option because that option is only available with the commercial version. I cannot find anything about getting the express version to compile 64-bit builds.

    At the moment I get the error message: "The application has failed to start because its side-by-side configuration...
    See more | Go to post

  • MrPickle
    started a topic Giving a computer wireless capabilities

    Giving a computer wireless capabilities

    I have a BTHomeHub and a Netgear WG602v4, would it be possible to connect the WG602v4 to my new computer and give it wireless capabilities?

    If so, what do I need to do? This is a very general question so sorry.
    See more | Go to post

  • MrPickle
    replied to c program
    in C
    You will have to be a little bit more specific.
    See more | Go to post

    Leave a comment:


  • MrPickle
    replied to Going through a node and it's children
    in C
    It's not my homework. I'm just a hobby programmer, well, for now.

    Thank you all. (:
    See more | Go to post

    Leave a comment:


  • MrPickle
    replied to Going through a node and it's children
    in C
    Thank you. I have taken the recursion route, just out of curiosity, what other ways is there to do this?
    See more | Go to post

    Leave a comment:


  • MrPickle
    started a topic Going through a node and it's children
    in C

    Going through a node and it's children

    I have a structure like so:

    Code:
    struct node
    {
    	float x, y, z;
    	std::vector<node> children;
    };
    and I want to loop through all the node's children, then all the children's children then all the children's children's children, etc..

    I know one way would be to use recursive functions, but is this the only way?

    Also, what's the proper name for this structure? I think it's a...
    See more | Go to post

  • MrPickle
    replied to Math equation
    in C
    I can't find the edit button so I'm having to post again;

    I've been looking into postfix notation, but I'm not sure whether this works with trig functions?

    Okay, trig does work with postfix notation, I know how to do this now.
    See more | Go to post

    Leave a comment:


  • MrPickle
    started a topic Math equation
    in C

    Math equation

    I want to take a math equation in a string format then translate this into code.

    For example;
    sin(x+2)^4 would translate into: std::pow(4, std::sin(x+2))

    but I'm not sure where to start, at first I decided to follow the order of operations, breaking down the equation and putting it into an array this gave me two problems
    a) Do I remove the selection from the string as I add it to the array?
    b) I wouldn't...
    See more | Go to post

  • So it doesn't effect the overall performance, just the clarity of the code?
    Thanks (:

    P.S:


    I always tend to use the former out of my if-then-else example, I just put the other one in to clarify I knew you could do it....
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...