Search:

Type: Posts; User: Brighteyes

Page 1 of 9 1 2 3 4

Search: Search took 0.01 seconds.

  1. Thread: guidence

    by Brighteyes
    Replies
    1
    Views
    873

    Here's a quick and dirty way to do it using conio...

    Here's a quick and dirty way to do it using conio and getch. Substitute your own nonblocking read where appropriate:


    #include <iostream>
    #include <string>
    #include <conio.h>

    using namespace...
  2. Replies
    4
    Views
    1,567

    >Any suggestions? thoughts? comments? How do I do...

    >Any suggestions? thoughts? comments? How do I do this?
    Not a bad problem, here's one way:


    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <time.h>

    #define LOW 1
  3. Thread: tab size

    by Brighteyes
    Replies
    6
    Views
    1,914

    In MS Visual Studio, go to...

    In MS Visual Studio, go to Tools...Options...Tabs. Set it up however you like from there.
  4. Replies
    37
    Views
    5,824

    >$Yea $right $gentle $boost $unless $you $talk...

    >$Yea $right $gentle $boost $unless $you $talk $like $this.
    I think anyone smart enough to figure out C++ would be able to catch on to scalar notation, don't you?
  5. Then you are compiling as C, it's not legal code...

    Then you are compiling as C, it's not legal code so you're sure to get a diagnostic when you try and compile. Try this instead:


    FILE * fileP;

    main()
    {
    char name[36];
    fileP =...
  6. Replies
    37
    Views
    5,824

    >How are C++ and php complimentary? PHP has...

    >How are C++ and php complimentary?
    PHP has similar syntax to C++ and is a gentle boost into the scripting world.
  7. fgets(name, sizeof (name), fileP); Though it...

    fgets(name, sizeof (name), fileP);

    Though it looks like you're compiling as C++ since C doesn't support variable declarations except at the top of a block of code.
  8. Use some flavor of getline: string data; ...

    Use some flavor of getline:


    string data;

    ...

    getline(fin, data);
  9. Replies
    6
    Views
    2,299

    >Is there any reason that you chose to use size_t...

    >Is there any reason that you chose to use size_t as opposed to int?
    The function doesn't work with negative indices and size_t is to be preferred over int for array indicies if you can manage it.
    ...
  10. She's probably attracted to you, but I wouldn't...

    She's probably attracted to you, but I wouldn't call it love. :rolleyes: Have you tried asking her for a date? If she says yes then that's typically a good sign. :p
  11. Replies
    1
    Views
    1,401

    You can try google, but this is a topic that some...

    You can try google, but this is a topic that some very large books are filled with. Maybe a trip to the bookstore would be better. :) I think Usenet has a comp.security group. I've never been there,...
  12. Replies
    6
    Views
    2,299

    >Can anyone suggest a way of improving the speed...

    >Can anyone suggest a way of improving the speed of this function?
    Don't bother until you're sure that there's a performance problem. Optimizing this function would probably result in it being...
  13. Replies
    4
    Views
    1,597

    >while(!feof(datafile)) Bzzzt! This is wrong,...

    >while(!feof(datafile))
    Bzzzt! This is wrong, look here to learn why.
  14. Thread: New Ad

    by Brighteyes
    Replies
    9
    Views
    2,625

    >I swear to GOD! If this turns into a "Use opera!...

    >I swear to GOD! If this turns into a "Use opera! Use Mozilla" bull$$$$ thread, I'll stop coming here.
    If you constantly blow up over such simple things then your not returning may be a good thing....
  15. Replies
    6
    Views
    4,239

    >Does your linked list has a pointer to the last...

    >Does your linked list has a pointer to the last node?
    Not built in, no. I decided against it for simplicity sake, though you can easily place an iterator to point at the end of the list if you need...
  16. Replies
    6
    Views
    4,239

    >Oh hell.. :) Would you like my double linked...

    >Oh hell.. :)
    Would you like my double linked list library? That would save you a lot of work. ;)

    It's in C though, for C++ the std::list would be way better.
  17. Replies
    2
    Views
    2,545

    DOS supports functions like that, though for...

    DOS supports functions like that, though for modern Windows systems I'm unaware of something that simple. Most APIs for Windows support 3D and windowing and all kinds of nifty doo dads, nobody wants...
  18. Replies
    6
    Views
    4,239

    Always check for an empty list: if (head) ...

    Always check for an empty list:


    if (head)
    head->prev = temp;

    You were dereferencing a null pointer by saying head->prev on the first prepend. At that point head was null, so you got...
  19. Replies
    11
    Views
    1,589

    >Where? Online somewhere, google it. >How?...

    >Where?
    Online somewhere, google it.

    >How?
    With great care. Garbage collectors are not simple and can be very tricky.

    >I have never see one...
    Probably because C++ as a language isn't suited...
  20. Replies
    23
    Views
    5,782

    >If so, what is the point of it? Microsoft...

    >If so, what is the point of it?
    Microsoft thought it up...that should tell you enough. ;) I've always been fond of this little gem from windows.h:


    typedef WORD ATOM;
  21. Thread: New Ad

    by Brighteyes
    Replies
    9
    Views
    2,625

    >If possible, can you avoid putting these on the...

    >If possible, can you avoid putting these on the site webmaster?
    Why are you even using IE? Opera will block all of those annoying ads with a satisfying gusto.
  22. Replies
    5
    Views
    7,364

    char buff[BUFSIZ]; // BUFSIZ defined in stdio ...

    char buff[BUFSIZ]; // BUFSIZ defined in stdio

    while(fgets(buff, sizeof (buff), inp1)){
    sscanf(buff,"%d %s %s %lf",&cAtom.num,cAtom.name,cAtom.symbol,&cAtom.weight);

    fgets returns NULL on...
  23. Replies
    8
    Views
    1,540

    >No prob wish i knew code for MTing in c++ :S It...

    >No prob wish i knew code for MTing in c++ :S
    It depends on what implementation of threads you use. pthreads can be used for Unix systems (check the man pages), or you can do it with Windows.
  24. Replies
    11
    Views
    1,589

    >search for a garbage collector Isn't that a bit...

    >search for a garbage collector
    Isn't that a bit of overkill? You would have to suffer the detrimental effects of a garbage collector for the life of the program whereas simply making sure there are...
  25. Replies
    18
    Views
    2,101

    I have the C/C++ programmers bible, it's crap. :)...

    I have the C/C++ programmers bible, it's crap. :) Not only is it highly DOS based, the code is rarely correct and often dangerous. Want to buy my copy? I'm trying to get rid of it. ;)
Results 1 to 25 of 205
Page 1 of 9 1 2 3 4