Search:

Type: Posts; User: MacNilly

Page 1 of 19 1 2 3 4

Search: Search took 0.01 seconds.

  1. You're error (warning) seems to appear on a line...

    You're error (warning) seems to appear on a line (94) that you haven't posted.
  2. You can't now. Moderators will fix it, maybe...

    You can't now. Moderators will fix it, maybe...
  3. Forum rule: Don't create a new thread for the...

    Forum rule: Don't create a new thread for the same problem. For everyone's sake.

    Maybe if this was Javascript, you'd get a "0" instead of a SEGFAULT.
  4. Replies
    3
    Views
    3,866

    Or consider why for (j = 0; j < 1;...

    Or consider why



    for (j = 0; j < 1; j++)//print base first


    is a "loop" that loops only once?
  5. Another option is to make "choice" an "int"...

    Another option is to make "choice" an "int" variable, and simply use another "scanf(%d, &choice)". IIRC, the %d specifier is defined to skip any leading whitespace in the input buffer. However, for...
  6. Remember, everything you write into the a...

    Remember, everything you write into the a buffered input stream, remains in the buffer, until it is read back out.*

    * This is a non-technical discussion, but at least holds for this case.
  7. I'm gonna take a gamble.. The ...

    I'm gonna take a gamble..

    The


    scanf("%d", &n);

    read an integer from the input buffer (standard input, STDIN), but left the '\n' (newline, return) character that you entered, is still in...
  8. Replies
    8
    Views
    7,766

    I recommend Cairo, I have used both the native C...

    I recommend Cairo, I have used both the native C library and the Python interface. Very good, IMO. +1 for Cairo!

    I actually once got quite into it, and ended up writing a (very simple) graphing...
  9. Replies
    3
    Views
    3,866

    Do you mean to draw a triangle? A pyramid is a 3D...

    Do you mean to draw a triangle? A pyramid is a 3D structure, and cannot faithfully be rendered using this technique.

    You want to render something like this?



    #
    #.#...
  10. Replies
    12
    Views
    32,787

    "But they do have the same IP address." Woah!...

    "But they do have the same IP address."

    Woah!

    Anyways... Maybe I meant "non-standard" instead of "vendor-specific". Although, I bet different vendors DID provide different prototypes within...
  11. Yes, unless I snarf properties of the...

    Yes, unless I snarf properties of the implementation language (Java currently), I have come to the conclusion that, in order to port to C, I will have to at least implement my own GC. I've been...
  12. Replies
    12
    Views
    32,787

    #include That's a vendor-specific...

    #include <conio.h>


    That's a vendor-specific (and outdated) header file. It doesn't exist in modern standard C, nor does any modern C compiler (that I know of) support it.

    In general, that's a...
  13. Thread: GC'd C++

    by MacNilly
    Replies
    9
    Views
    5,304

    Thanks for the replies. I really only care...

    Thanks for the replies. I really only care because I'd like to port a Java project into C++, and I'm concerned about how to manage memory usage. The project is a simple interpreter for a functional...
  14. No worries, I know (knew) some "professional"...

    No worries, I know (knew) some "professional" (paid) programmers who stated that they really don't "get" pointers, or at least C pointers. Every language has "pointers" whether they are hidden behind...
  15. Replies
    3
    Views
    2,759

    There's some math explanation here if you like...

    There's some math explanation here if you like it. I'd say reducing you're loop from O(N) to O(log_2 N) is quite an improvement!

    algorithm - Why do we check up to the square root of a prime number...
  16. Replies
    3
    Views
    2,759

    One optimization I've seen is to only check...

    One optimization I've seen is to only check divisors up to the sqrt of the number being checked for primality.
  17. Thread: GC'd C++

    by MacNilly
    Replies
    9
    Views
    5,304

    Because, say 2 objects A and B, A contains a...

    Because, say 2 objects A and B, A contains a reference to B, and B contains a reference to A, their reference count is 1 for each of A and B, always. Even if no other object C has a reference to it....
  18. Replies
    12
    Views
    1,750

    The real heart of the halting "problem" is for...

    The real heart of the halting "problem" is for people trying to prove that some algorithm they invented always terminates for all inputs. Like those graph and sorting algorithms you've heard of.....
  19. Thread: GC'd C++

    by MacNilly
    Replies
    9
    Views
    5,304

    One last idea: the hardware stack is...

    One last idea: the hardware stack is "automagically" GC'd, and C++ "smart pointers" take advantage of this using their destructors and reference counting to release resources when the _pointers_ are...
  20. Thread: GC'd C++

    by MacNilly
    Replies
    9
    Views
    5,304

    A similar train of thought: "The idea behind...

    A similar train of thought:

    "The idea behind C++ was that you would not pay any performance impact for features that you don't use. So adding garbage collection would have meant having some...
  21. Thread: GC'd C++

    by MacNilly
    Replies
    9
    Views
    5,304

    GC'd C++

    I've heard rumors of a GC'd C++. Is it possible, and what are the implications? Wouldn't it just have to end up being an (compiled) interpreter that gets embedded into the executable at runtime?

    I...
  22. For some reason I can't post the link. Just...

    For some reason I can't post the link. Just google "The C programming Language by Brian W. Kernighan and Dennis M. Ritchie." It's a free PDF and covers everything C, including functions.

    BTW, C...
  23. Replies
    8
    Views
    4,757

    #include "windows.h" #include "iostream"...

    #include "windows.h"
    #include "iostream"
    #include "support.h"


    That's just wrong.

    [EDIT]

    Actually that code is just wrong. Horrid.
  24. Replies
    8
    Views
    4,757

    The correct answer is ... "I have no idea, unless...

    The correct answer is ... "I have no idea, unless you provide a context".

    [EDIT]

    Oh, how gross...
  25. Ok, nevermind about that detail. It was too...

    Ok, nevermind about that detail. It was too detailed.


    Whats the confusion here? You understand that the function



    int contar_caracter(char *string, char ch)
Results 1 to 25 of 469
Page 1 of 19 1 2 3 4