I have a program that should take some points that make a straight line and calculate a slope. I am getting some random garbage and I don't know why.
I have a class "Line":
class Line
{
...
Type: Posts; User: w274v
I have a program that should take some points that make a straight line and calculate a slope. I am getting some random garbage and I don't know why.
I have a class "Line":
class Line
{
...
Anyone know where to find a good tutorial on composite classes?
Do they go by a different name?
I can't seem to find anything on this site, or even on the message boards.
Yea OK that makes sense, I don't know why I thought I had to have those there.
I'll have to try the program when i'm back on my other computer and see how she goes.
Thanks.
Just delete those double arguements and make them private class members if they aren't already. Class functions can access class members without them being passed to the function.
You are right,...
Those first things Dave said don't seem to be contributing to the problem.
Point2D is declared:
Point Point2D[MAXNUMPTS];
I'm not sure about your new code, it seems rather advanced for...
I 'm having trouble with a part of my program that reads in points (coordinates) from a file and then prints them out. It's spitting out garbage. I think it has to do with the printing rather than...
thanks
My program compiles fine, but I get this when I try to build it using MS VC++:
main.obj : error LNK2001: unresolved external symbol "double __cdecl coordinates::distancePoint2D(double,struct...
When I go to compile my program, I keep getting the following error:
error C2224: left of '.iID' must have struct/union type
error C2224: left of '.sStudentName' must have struct/union type...
So is there no way to do something like this:
struct Person {
char *name;
int age;
float height;
} people[] = {
{"fscanf(inp, "%s", &people[1])", fscanf(inp, "%s",...
Hey,
I've read the tutorials on structs and arrays, and my program needs to be much like this piece below...
struct Person {
char *name;
int age;
float height;
i dont think you understood me. i removed the ";" and it still didnt work
Nope, that didn't seem to do it...
I've tried the rest of my code by getting rid of the file input stage and manually entering the numbers, and it works fine.
But why this is not working...
I am writing a program that scans data from a file into an array. It then prints out the contents of the file and finds the average.
It compiles and builds without error, but for some reason...
Hi,
I've been using "visual c++" on my school's computers, but i'd like to have something to compile and build my programs on my home computer.
Does anyone know of any good, free compilers you...
Say, for example, that I had the following in my array:
Hi! I'm Rob
This function would put the "H" and the "i" as the 0 and 1 elements in my new array. But since the next one is a "!", it...
So if I erase the "else" statement, what will happen if the "if" statement can't be satisfied (a non-alphabetical character)?
Hi,
I have an array "iWord", and i'm trying to build a function that takes the punctuation and spaces out of it and puts it in a new array containing only letters, "iAlphaWord". Here is what I have...
Thanks I'll try what you said...but i have it set up so that if my file is non-existant, it will notify me.
if (inp == NULL)
{
printf("Unable to open file!\n");
return (-1);
}
I am using the exact same compiler. Your code is also exactly the way I have it.
But it DID work before when I had it all written in "main", so that can't be my problem.
You had said that this loop of mine was not right:
iStatus = fscanf(inp, "%d %d", &iId[0], &iScore[0]);
while (iStatus != EOF)
{
iNum++;
iStatus = fscanf(inp, "%d %d", &iId[iNum],...
I had fixed that, but even then, It still refuses to work.
It won't do ***anything*** at all....It starts up, but I receive a Windows error message and the command promp shuts down.
I have made the changes you suggested, and my program will now succesfully compile and build, but it will not run.
Here is the new code:
/*This program will input data into two parallel...