Search:

Type: Posts; User: jimblumberg

Search: Search took 0.07 seconds.

  1. Thread: Structs:

    by jimblumberg
    Replies
    18
    Views
    1,825

    Just remember that there is very little...

    Just remember that there is very little difference between a struct and a class in C++. And remember one of the greatest strengths, IMO, of C++ is Classes. Information hiding and encapsulation are a...
  2. Thread: Structs:

    by jimblumberg
    Replies
    18
    Views
    1,825

    Why not use a constructor for your class? ...

    Why not use a constructor for your class?



    struct StudentRecord
    {
    StudentRecord() : ID(1234), GPA(4.0)
    {
    strcpy(Name, "SuperProgrammer");
    }
  3. Thread: Structs:

    by jimblumberg
    Replies
    18
    Views
    1,825

    Very! What's wrong with something like: ...

    Very!

    What's wrong with something like:


    char array[name_size] = "SuperProgrammer";

    Jim
  4. Thread: Structs:

    by jimblumberg
    Replies
    18
    Views
    1,825

    Out of bounds because you try to access your...

    Out of bounds because you try to access your array past the end of the array. You defined your array with a size of name_size so when you try to access name_size you're accessing your array out of...
  5. Thread: Structs:

    by jimblumberg
    Replies
    18
    Views
    1,825

    Your function call, function implementation and...

    Your function call, function implementation and function prototype must all agree as to the number and type of parameters.

    Also you need to add some variable names to your function...
Results 1 to 5 of 5