Search:

Type: Posts; User: nirvana21

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    2,704

    Is this how the computer would operate on this...

    Is this how the computer would operate on this problem?
  2. Replies
    3
    Views
    2,704

    Question About Binary Division

    How would I divide these two binary numbers?

    100101/011011

    This is assuming I am on a 6bit 2's complement machine. I would understand how to do it if the first number were not negative. How do...
  3. Replies
    6
    Views
    1,006

    I thought I was taking the value '1', not ASCII...

    I thought I was taking the value '1', not ASCII '31'. Should I make number an int, then process it with a modulo instead? Thanks!
  4. Replies
    6
    Views
    1,006

    Well if I run that program I get a bogus answer....

    Well if I run that program I get a bogus answer. For example if I input 2 as the base and 111 as the number the answer should be 7. If I take out number[index] from the highlighted part it works for...
  5. Replies
    6
    Views
    1,006

    What Am I Doing Wrong?

    I have been toying with this problem for a bit and it is starting to annoy me. I cannot find the fault in this program. I believe the problem is due to the use of number[index]. Please help, thanks!...
  6. Replies
    25
    Views
    3,584

    I am having a rounding problem as well. I thought...

    I am having a rounding problem as well. I thought that a number that is converted from double or float to an int would round up. Example: double .001 = int 1. This must not be the case because I am...
  7. Replies
    25
    Views
    3,584

    So this doesn't cause an error, its just...

    So this doesn't cause an error, its just inefficient?


    ++letters[index];
    This increases the variable beforehand correct? So really what I had would have worked but this is sleeker?


    Thanks
  8. Replies
    25
    Views
    3,584

    Here is my final program. Please critique if you...

    Here is my final program. Please critique if you feel like it. I am new to C++ so tell me how it is.


    #include <iostream>
    #include <iomanip>
    #include <fstream>
    #include <string>
    ...
  9. Replies
    25
    Views
    3,584

    I just want to say that this forum has really...

    I just want to say that this forum has really helped me with this program. Thanks to all of you. Maybe later I will post my final program to be critiqued.

    :cool:
  10. Replies
    25
    Views
    3,584

    Alright, well I am gonna ask a few questions...

    Alright, well I am gonna ask a few questions about this because I have just recently started C++; I hope you don't mind Elysia.


    1. Why does it matter that the '&' symbol is connected to ifstream...
  11. Replies
    25
    Views
    3,584

    Excellent, everything has worked out. THANKS!

    Excellent, everything has worked out. THANKS!
  12. Replies
    25
    Views
    3,584

    So now I can compile which is a lot better then...

    So now I can compile which is a lot better then where I was. So I am curious; why does the variable "filename" have to be a pointer?

    I get a segmentation fault when I attempt to open a .txt or...
  13. Replies
    25
    Views
    3,584

    So a reference can be thought of as a type of...

    So a reference can be thought of as a type of pointer with restrictions? The reference does not pass the memory address, rather it directly accesses the value?

    I have tried using a reference but I...
  14. Replies
    25
    Views
    3,584

    If I pass a reference can I still pass back the...

    If I pass a reference can I still pass back the location of the file so it can be utilized in another function? Later I will make another function that will read the characters. Is there a different...
  15. Replies
    25
    Views
    3,584

    How do you pass a reference?

    How do you pass a reference?
  16. Replies
    25
    Views
    3,584

    I am close, but after these alterations I still...

    I am close, but after these alterations I still get one error. Am I correct in thinking that FILE is used in C and fstream is C++ "edition" or however I should word it? Thank you very much for the...
  17. Replies
    25
    Views
    3,584

    Trouble with file pointer

    Hi!

    I am trying to create a file pointer so I can read characters from a text file. I am not sure that I am doing this correctly. I have been reading a book I have, but I have not quite grasped...
  18. Replies
    5
    Views
    1,082

    Thank you so much! That worked for me!

    Thank you so much! That worked for me!
  19. Replies
    5
    Views
    1,082

    Thanks for the insight so far! I initialized the...

    Thanks for the insight so far! I initialized the array, but...

    I am not sure how to make my structure a pointer. I tried this, but it is not right:




    ....

    void input (id *, int); ...
  20. Replies
    5
    Views
    1,082

    Trouble Passing Structures

    I am trying to pass structures that I have in an array. The code compiles but the programs spews trash when it runs. Does anybody have an suggestions for me to fix this?


    #include <stdio.h>...
  21. Replies
    2
    Views
    946

    yep, that was it. Thanks!

    yep, that was it.

    Thanks!
  22. Replies
    2
    Views
    946

    Is this not the same value?

    I have just recently started to learn C. I have been playing around with different code to teach myself. I cannot figure out the following code:


    #include <stdio.h>

    void testfunction (int *);...
Results 1 to 22 of 22