Search:

Type: Posts; User: Dweia

Page 1 of 5 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    9
    Views
    1,565

    To access individual elements in an array you...

    To access individual elements in an array you need to use something like cout << jane[element];

    So use a loop to loop through, incrementing a counter, to print out each element.

    Any tutorial on...
  2. Thread: "Stand By"?

    by Dweia
    Replies
    11
    Views
    1,374

    I would guess it keeps the necessary power in...

    I would guess it keeps the necessary power in order to preserve volatile memory, or else writing all the contents to non-volatile storage, to be retrieved later upon powering back up, but mostly...
  3. Replies
    3
    Views
    5,546

    Correct me if I'm wrong, but it looks like all...

    Correct me if I'm wrong, but it looks like all he's done is get an iPod to support DRM other than Apple's.

    I mean, I've always been able to put DRM-less music on my iPod without a problem, so...
  4. Replies
    8
    Views
    2,544

    Stick an int n = 0 at the start, then in the loop...

    Stick an int n = 0 at the start, then in the loop put n++;
    Each time the loop goes through n is incremented, thus n == number of times looped.
  5. Replies
    7
    Views
    41,641

    Well, close enough. I appear to have thought I...

    Well, close enough. I appear to have thought I was in the C++ forum.
  6. Replies
    7
    Views
    41,641

    Why not just something like for(int...

    Why not just something like
    for(int n=0;n<length;n++)
    {
    if(arr[n] == '&')
    return true;
    }
    return false;

    That's assuming you know the length of your array, which you should....
  7. Replies
    5
    Views
    2,750

    You don't appear to allocate any memory for...

    You don't appear to allocate any memory for firstFileLine, which would be your problem.
    In fact, you're trying to write to a null pointer in your fgets.

    Just use char firstFileLine[50] to...
  8. Replies
    54
    Views
    4,427

    Ending if someone enters 1: You can end a...

    Ending if someone enters 1:
    You can end a program by calling exit(0), or return 0 if you're in main.
    You can test if someone's input is 1 by something like if(input == 1)

    To convert a decimal...
  9. Replies
    13
    Views
    27,876

    int n; cin >> n; cout

    int n;
    cin >> n;
    cout << n;

    I enter 'foo' when it asks for input, the cin fails, nothing is written to n, it is 'empty' (aside from the garbage value from not initialising it).
    Basically it's a...
  10. Replies
    13
    Views
    27,876

    cin into a string instead, which you can check...

    cin into a string instead, which you can check for emptiness, then convert the string to an integer.

    citizen: When you declare a variable without initialising it e.g. int n; it basically contains...
  11. Replies
    37
    Views
    8,762

    Just as well this topic is about a language to...

    Just as well this topic is about a language to learn for fun, rather than a serious language to use for large scale projects.

    As has been mentioned, it's easy, it's very much like C, it has...
  12. Replies
    10
    Views
    1,363

    Single precision is 24 bits of precision...

    Single precision is 24 bits of precision (including leading 1) while double is 53, which yes, works out to about 7 and 15 decimal places
  13. Replies
    19
    Views
    2,105

    That code looks to be a snipper from a recursive...

    That code looks to be a snipper from a recursive function, which calculates the x^n.

    What it does is you call the first function, with 2^3 say.
    It returns 2*2^2, then to work out 2^2 it calls the...
  14. Replies
    37
    Views
    8,762

    I haven't seen anyone mention PHP yet so I will....

    I haven't seen anyone mention PHP yet so I will.

    I found it an extremely easy language to learn, syntax is basically C syntax, www.php.net has a good function reference.

    Otherwise, Perl isn't...
  15. Replies
    11
    Views
    2,118

    I believe trig functions and similar are done...

    I believe trig functions and similar are done using a Taylor Series to approximate to a given precision.
    http://en.wikipedia.org/wiki/Taylor_series

    Note: I said believe, I could easily be wrong,...
  16. Replies
    5
    Views
    1,166

    How is the total average 2 in your above example...

    How is the total average 2 in your above example (4 4 4)?

    Anyway, you appear to keep track of positive and negative amounts seperately, so just test if it == 0.

    If nSum == 0 then no negative...
  17. Replies
    4
    Views
    2,454

    getaddrinfo or gethostbyname on the local host...

    getaddrinfo or gethostbyname on the local host (obtained by gethostname) should return all the IP addresses of the local host (127.0.0.1 and another).
  18. Thread: Riddles to solve

    by Dweia
    Replies
    5
    Views
    8,291

    Is each line a seperate unrelated riddle? And is...

    Is each line a seperate unrelated riddle?
    And is this all the information we're given?
  19. Replies
    41
    Views
    7,992

    See, I was always told that cats are smart, and...

    See, I was always told that cats are smart, and they won't overeat.

    From my experience with my cat though, if you give him too much food he'll just stuff himself.

    And then go lie down in the...
  20. Replies
    41
    Views
    7,992

    He's heavy enough that it feels like he must be...

    He's heavy enough that it feels like he must be sometimes.
    I think I feed him too much sometimes, but he never likes dieting.
  21. 1. I believe c_str just returns const char *...

    1. I believe c_str just returns const char * rather than changing whether or not you're using unicode.

    http://msdn2.microsoft.com/en-us/library/3372cxcy.aspx

    2. Not a clue off the top of my...
  22. Replies
    3
    Views
    3,852

    Market it as a genuine Aztec, Spanish, etc...

    Market it as a genuine Aztec, Spanish, etc artefact, whichever one they like the sound of better, and surely someone will buy it eventually.
  23. Replies
    9
    Views
    3,120

    You said it yourself, it supports more languages....

    You said it yourself, it supports more languages. If you're only going to develop in english, then yes, Unicode isn't likely to offer that much extra use, although I believe it also has some extra...
  24. Replies
    41
    Views
    7,992

    My Cat:...

    My Cat:
    http://img145.imageshack.us/my.php?image=vinceedited9yc.jpg
  25. He's padding the number out to 8 digits, or one...

    He's padding the number out to 8 digits, or one byte.

    0100 = 100.
Results 1 to 25 of 112
Page 1 of 5 1 2 3 4