Search:

Type: Posts; User: w274v

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Thread: Class problem

    by w274v
    Replies
    3
    Views
    1,022

    Class problem

    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
    {
    ...
  2. Replies
    2
    Views
    1,850

    Composite Classes

    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.
  3. Replies
    7
    Views
    1,299

    Yea OK that makes sense, I don't know why I...

    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.
  4. Replies
    7
    Views
    1,299

    Just delete those double arguements and make them...

    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,...
  5. Replies
    7
    Views
    1,299

    Those first things Dave said don't seem to be...

    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...
  6. Replies
    7
    Views
    1,299

    File I/O, classes

    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...
  7. Thread: Linker error

    by w274v
    Replies
    2
    Views
    921

    thanks

    thanks
  8. Thread: Linker error

    by w274v
    Replies
    2
    Views
    921

    Linker error

    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...
  9. Thread: Structures

    by w274v
    Replies
    2
    Views
    1,166

    Structures

    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...
  10. Replies
    5
    Views
    1,019

    So is there no way to do something like this: ...

    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",...
  11. Replies
    5
    Views
    1,019

    Structures and Arrays

    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;
  12. Replies
    6
    Views
    1,903

    i dont think you understood me. i removed the ";"...

    i dont think you understood me. i removed the ";" and it still didnt work
  13. Replies
    6
    Views
    1,903

    Nope, that didn't seem to do it... I've tried...

    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...
  14. Replies
    6
    Views
    1,903

    Trouble with file input

    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...
  15. Replies
    6
    Views
    1,764

    Free Compiler Downloads?

    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...
  16. Thread: Strings

    by w274v
    Replies
    6
    Views
    1,184

    Say, for example, that I had the following in my...

    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...
  17. Thread: Strings

    by w274v
    Replies
    6
    Views
    1,184

    So if I erase the "else" statement, what will...

    So if I erase the "else" statement, what will happen if the "if" statement can't be satisfied (a non-alphabetical character)?
  18. Thread: Strings

    by w274v
    Replies
    6
    Views
    1,184

    Strings

    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...
  19. Replies
    19
    Views
    3,325

    Thanks I'll try what you said...but i have it set...

    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);
    }
  20. Replies
    19
    Views
    3,325

    I am using the exact same compiler. Your code is...

    I am using the exact same compiler. Your code is also exactly the way I have it.
  21. Replies
    19
    Views
    3,325

    But it DID work before when I had it all written...

    But it DID work before when I had it all written in "main", so that can't be my problem.
  22. Replies
    19
    Views
    3,325

    You had said that this loop of mine was not...

    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],...
  23. Replies
    19
    Views
    3,325

    I had fixed that, but even then, It still refuses...

    I had fixed that, but even then, It still refuses to work.
  24. Replies
    19
    Views
    3,325

    It won't do ***anything*** at all....It starts...

    It won't do ***anything*** at all....It starts up, but I receive a Windows error message and the command promp shuts down.
  25. Replies
    19
    Views
    3,325

    I have made the changes you suggested, and my...

    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...
Results 1 to 25 of 36
Page 1 of 2 1 2