Search:

Type: Posts; User: arrgh

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    16
    Views
    2,370

    I see. Inheritance might have been the issue. I...

    I see. Inheritance might have been the issue. I remember going over that in class, but that was after I got lost over the process of designing a software program to be used in the "real world", so...
  2. Replies
    16
    Views
    2,370

    Is there a way to fix it? Or is it better to not...

    Is there a way to fix it? Or is it better to not use base pointers in derived classes?
  3. Replies
    16
    Views
    2,370

    Nope, it's just testing whether you can...

    Nope, it's just testing whether you can understand the code. Just know general output and ignore compile errors. If ExampleClass 3 is printed out, then what exactly do you have to watch out for when...
  4. Replies
    16
    Views
    2,370

    There was a side note mentioning "be careful with...

    There was a side note mentioning "be careful with pointer arithmetic" and 3 seems like the obvious answer, so...
  5. Replies
    2
    Views
    1,776

    hehe, oops... must have zoned out when the prof...

    hehe, oops... must have zoned out when the prof was explaining it.
    Thanks for clearing that up!
  6. Replies
    16
    Views
    2,370

    ExampleClass 3. But like I said, that doesn't...

    ExampleClass 3. But like I said, that doesn't seem right.
  7. Replies
    16
    Views
    2,370

    Last Minute Reviewing

    I'm studying for an exam, and I had some quick questions. What does this code output?


    class ExampleClass {
    private: int i;
    public:
    ExampleClass(int j) { i=j; }
    int get_i() { return...
  8. Thread: Review for Test

    by arrgh
    Replies
    8
    Views
    1,569

    If you declare a variable extern inside a...

    If you declare a variable extern inside a function, then the variable has static storage duration, but still has a block scope, so is there a way to change the scope of a variable within a function?
  9. Replies
    2
    Views
    1,776

    Modules and Member Functions

    I have 3 files: stack.h, calc,c and stack.c

    void make_empty(void);
    int is_empty(void);
    int pop(void);

    #include "stack.h"
    main() {
    make_empty();
    ...
  10. Thread: Review for Test

    by arrgh
    Replies
    8
    Views
    1,569

    But which has greater precedence? For example: ...

    But which has greater precedence? For example:

    i >> ~j ^ k
    Would this be (i >> (~j)) ^ k or i >> ((~j) ^ k)?
  11. Replies
    6
    Views
    12,077

    Oooh. So initialization is basically creating a...

    Oooh. So initialization is basically creating a variable and assigning it a value all in go, and assignment is changing the value of an already existing variable. It makes more sense when you say it...
  12. Thread: Review for Test

    by arrgh
    Replies
    8
    Views
    1,569

    Review for Test

    I'm studying for an exam, so hopefully someone can clarify some things for me. Thought I'd post everything under one thread, instead of making a new one for every question that comes up. I typed up a...
  13. Replies
    6
    Views
    12,077

    Assignment vs. Initialization

    I'm studying for an exam and just came across a sentence: "Initialization isn't the same as assignment." What? I thought when you assigned a variable a value, you're initializing the variable. If...
  14. Replies
    1
    Views
    1,582

    Definition, Assignment, Declaration

    I know that the first is a declaration, and the second is an assignment:
    int a;
    a = 1;
    What does it mean by "if an identifier is defined"? Has it been declared and assigned or just declared?
    ...
  15. Replies
    5
    Views
    1,833

    How would you go about writing the code for...

    How would you go about writing the code for calculating the determinant of a matrix? I've got the math part figured out, but I can't seem to find the pattern to use in a for loop.

    [ 11 12 13 ]...
  16. Replies
    5
    Views
    1,833

    C Programming Exercises

    I'm reviewing for an exam by working the chapter exercises, and I'm confused on how to use and write the compare function for qsort.

    "Write a program that prompts the user to enter a series of...
  17. Replies
    2
    Views
    980

    I figured out how to create a linked list. Now...

    I figured out how to create a linked list. Now I'm having a problem with a while loop that adds 2 polynomials together. Everything seems to work correctly up until exiting where the loop checks the...
  18. Replies
    2
    Views
    980

    Help with Linked Lists

    I'm trying to use a for loop to create new structures of a linked list, but I keep overwriting the last struct and I don't know how to fix it.



    struct node *make_linked_list(char *pointArray[],...
  19. Thread: help with error

    by arrgh
    Replies
    29
    Views
    2,872

    Okay, I'm really confused about linked lists. I'm...

    Okay, I'm really confused about linked lists. I'm trying to add a node for each term of a polynomial containing the coefficient and the exponent, and I have no clue how to connect the new node to the...
  20. Thread: help with error

    by arrgh
    Replies
    29
    Views
    2,872

    YAY, everything works... Thanks, everybody!! ...

    YAY, everything works... Thanks, everybody!!

    Now, next question: What would the function header for a function that returns an array of pointers to structures and takes in an array of pointers...
  21. Thread: help with error

    by arrgh
    Replies
    29
    Views
    2,872

    The first number is supposed to be the number of...

    The first number is supposed to be the number of polynomials in the file. So the empty string should be polynomial "0".
  22. Thread: help with error

    by arrgh
    Replies
    29
    Views
    2,872

    Hehe, oops... Thanks! Since the 10th...

    Hehe, oops... Thanks!

    Since the 10th polynomial doesn't exist, how would you change the empty array to 0? Could you just insert an if statement checking whether each array is "" and then replace...
  23. Thread: help with error

    by arrgh
    Replies
    29
    Views
    2,872

    ok, new code. I'm not sure if I'm using the fgets...

    ok, new code. I'm not sure if I'm using the fgets right, since I usually get by with looping scanf("%c"...), but since the program works, I think I'm going in the right direction. I haven't freed...
  24. Thread: help with error

    by arrgh
    Replies
    29
    Views
    2,872

    I think I've found the problem. I'm supposed to...

    I think I've found the problem. I'm supposed to read in 10 polynomials from a file, but there's only 9 available, so the last should be a 0. I remember someone saying that calloc creates a block of...
  25. Thread: help with error

    by arrgh
    Replies
    29
    Views
    2,872

    So now I've got the warnings down to fscanf and...

    So now I've got the warnings down to fscanf and fopen are unsafe and one other:

    warning C4047: '=' : 'char' differs in levels of indirection from 'void *'
    line 61, which is
    *(a+p) = ch;
    ...
Results 1 to 25 of 34
Page 1 of 2 1 2