Search:

Type: Posts; User: TheSquid

Search: Search took 0.01 seconds.

  1. Replies
    9
    Views
    3,992

    I'm on Ubuntu 9.04. The code is pretty big, but...

    I'm on Ubuntu 9.04. The code is pretty big, but the previous suggestion worked.
  2. Replies
    9
    Views
    3,992

    So it does, thanks. As an aside, I had already...

    So it does, thanks.

    As an aside, I had already tried this using "#define _XOPEN_SOURCE" which was specified in the man page on my system, but it didn't work like yours did. Can you explain this...
  3. Replies
    9
    Views
    3,992

    It appears to be linking fine. I checked for...

    It appears to be linking fine. I checked for strptime in time.h and it is in there with the same declaration.
  4. Replies
    9
    Views
    3,992

    I am including time.h Here are my declarations:...

    I am including time.h
    Here are my declarations:

    struct tm dStart, dEnd, cDate;

    char *timeString;

    I have confirmed that timeString contains "2003-09-31"
  5. Replies
    9
    Views
    3,992

    strptime Warning

    I'm trying to use strptime to convert a string to a time structure, but I'm getting this warning from gcc:

    main.c:198: warning: comparison between pointer and integer

    This is the line that is...
  6. Replies
    8
    Views
    6,773

    That does make sense. Thanks everyone, I'll...

    That does make sense.

    Thanks everyone, I'll make some changes and see if I can get it working.
  7. Replies
    8
    Views
    6,773

    Isn't this: typedef struct { /* blah...

    Isn't this:


    typedef struct {
    /* blah blah blah */
    } *Line;

    typedef struct { ...
  8. Replies
    8
    Views
    6,773

    Malloc, Pointers, and Structs

    It's been a while since I've had to use C, and I'm getting a warning that I can't figure out regarding a dynamic array of structs. Here's an example of the situation I've got (not real variable...
  9. Replies
    5
    Views
    2,753

    I don't think they will be. He should be able to...

    I don't think they will be. He should be able to input any function that is continuous and differentiable over a given range. That's why I was hoping someone out there already wrote a library that...
  10. Replies
    5
    Views
    2,753

    Input and Parse Math Functions

    I'm in a numerical analysis class and our assignment is to use Newton's method to estimate roots of a fuction after n steps. That is the easy part, but our professor decided that he wants to be...
  11. Replies
    5
    Views
    2,562

    Problem with itoa() perhaps?

    Okay, I've tried everything I can think of including couts all over the place to see what my values looks like and I'm out of ideas, so I'll see if anyone else can figure it out.
    For starters, I'm...
  12. Replies
    1
    Views
    4,732

    Quadratic Probing

    While trying to make a quadratic probing hashtable I decided to test it by adding four words that hash to the same value so I can see where they are being added. The first word gets added to index...
  13. Replies
    6
    Views
    2,216

    Destroying a vector of classes

    I'm taking a data structure and algorithm in C++ class where we are expected to know about and be able to use vectors, a topic which my previous C++ class neglected to mention. From what little I...
  14. Replies
    4
    Views
    2,467

    I can't believe I forgot the ';' at the end. ...

    I can't believe I forgot the ';' at the end. Just goes to show what fresh eyes can do. One more minor thing: when I add "using namespace std;" and <vector> to the h file should they be outside or...
  15. Replies
    4
    Views
    2,467

    Errors in a simple hash table class.

    I decided to test-compile a class that I'm making and I'm getting strange errors which i've never seen before in some very simple code. I'm posting the three files here with errors numbered and...
  16. Replies
    22
    Views
    3,085

    As an aside to this topic, I feel the need to...

    As an aside to this topic, I feel the need to mention something about Suzumebachi's fix. His solution will work but there is one flaw, the use of goto when a simple loop will do the same thing.
    ...
  17. Replies
    14
    Views
    1,588

    isalnum() returns true if the character is...

    isalnum() returns true if the character is alphanumeric.

    This will fix it:


    if (isalnum(ch))
    cout<<ch<<" "<<asc<<"\n";
    else
    cout<<"Please enter a correct number or letter: \n";
  18. Replies
    14
    Views
    2,853

    I don't have any experience with vectors yet, so...

    I don't have any experience with vectors yet, so maybe this isnt an option, but since you are already including the string library why can't you just use the strtok function to split up your string?
  19. Replies
    27
    Views
    5,085

    Multiple Inputs

    There are several sites that can help you if you just google for scanf,
    but here is the quick answer:

    When you use a scanf statment you can have the user input a string of multiple values each...
  20. Replies
    15
    Views
    3,286

    On goto

    Looks like I'm a bit late to respond to this post, but I thought I'd add my two cents. I would suggest you take the advice of CornedBee and Master5001 and use loops rather than goto statements, as...
  21. Replies
    6
    Views
    4,089

    Wallpaper Woes

    I know there is probably something out there that does this already, but I'm working on a program that selects a random wallpaper from a user-defined list each time Windows starts. I assumed the...
  22. Replies
    4
    Views
    1,641

    There are a few problems with your switch. First...

    There are a few problems with your switch. First if you want your faces to be of type char, each case needs to be enclosed in single quotes like you did with the A. Also each case should have a...
  23. Replies
    4
    Views
    1,102

    While I agree with sand_man that you don't need...

    While I agree with sand_man that you don't need to reuse the formula when you are storing the result in interest, I also noticed that you left a semicolon off of this line:

    ...
  24. Thread: Bit Shifts

    by TheSquid
    Replies
    2
    Views
    1,201

    Thanks, I knew I was probably over-complicating...

    Thanks, I knew I was probably over-complicating things.
  25. Thread: Bit Shifts

    by TheSquid
    Replies
    2
    Views
    1,201

    Bit Shifts

    Hey everybody,

    I just searched through the posts on bit manipulation and I didn't see this question, but if it was there and I missed it I appologize. Anyway, if I shift a number left or right is...
Results 1 to 25 of 25