User Profile
Collapse
-
I believe the extra character you are seeing is the null terminator '\0'. This is to signify the end of the string. -
Also, dij() need to come before calldij() because calldij() is calling dij(), or you can pre-define it.Leave a comment:
-
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.12Leave a comment:
-
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&
Leave a comment:
-
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
Leave a comment:
-
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) {
-
-
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); }
I don't understand why?... -
For loops
When I define a for loop like so:
Code:for(initialize; condition; increment) { //code }
For example:
Code:for(unsigned int i = 0; i < foo(); i++) { //code }
Sidenote: I know I could easily test this but it's bugging me and I do not currently have a compiler... -
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)
Code:void showResult(FILE*,int id[],char name[],float mid[],float final[],int lab[],int*);
Leave a comment:
-
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.Leave a comment:
-
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... -
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. -
-
It's not my homework. I'm just a hobby programmer, well, for now.
Thank you all. (:Leave a comment:
-
Thank you. I have taken the recursion route, just out of curiosity, what other ways is there to do this?Leave a comment:
-
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; };
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... -
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.Leave a comment:
-
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... -
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....Leave a comment:
No activity results to display
Show More
Leave a comment: