Search:

Type: Posts; User: SeriousTyro

Search: Search took 0.01 seconds.

  1. Replies
    9
    Views
    1,961

    That's what I'm getting it but there will be a...

    That's what I'm getting it but there will be a sleep() within the while loop so it won't exactly end at the endtime depending on the sleep argument.

    I'll just do it the way I thought of.


    ...
  2. Replies
    9
    Views
    1,961

    The user will enter the number of milliseconds...

    The user will enter the number of milliseconds between each packet generated. My program will essentially sleep for that specified time then return to the loop.

    I could use gettimeofday() to...
  3. Replies
    9
    Views
    1,961

    Setting time length of program

    I know there is a sleep() function that lets you "idle" the program for a specified length of time but I was wondering if there was a function that lets you run the program for a specified length of...
  4. Replies
    2
    Views
    2,303

    Thanks a lot PehJota! I was getting to the point...

    Thanks a lot PehJota!
    I was getting to the point of having meaningless short ops for my long options but having them as numbers works the same way.

    The reason why I had so many colons for my...
  5. Replies
    2
    Views
    2,303

    getopt_long

    Haven't done much C programming before so I've been looking at examples and forming my program around them.

    I was wondering how to store a long option's argument that has no short option?

    e.g....
  6. Replies
    14
    Views
    2,562

    AHHH that's so true!!! When I first thought u...

    AHHH that's so true!!! When I first thought u could only get one line at a time, I thought i would have to break up each line but with fgetc it gets the job done. yea my way was pretty bleh... Your...
  7. Replies
    14
    Views
    2,562

    wow i'm so stupid, i completely forgot u could...

    wow i'm so stupid, i completely forgot u could get a single char at a time. i was thinking you could only read one line at a time!! i completely forgot !!! argh!!! i feel so stupid!!!!
  8. Replies
    14
    Views
    2,562

    yea, i got that down but is there no way to...

    yea, i got that down but is there no way to combine multiple 1D arrays into one giant 1D array? i could do it manually with a for loop but maybe i'm just trying to find an easy way out. guess i'll...
  9. Replies
    14
    Views
    2,562

    i'm trying to Find the greatest product of five...

    i'm trying to Find the greatest product of five consecutive digits in the 1000-digit number. so i'll be looking at each index and doing this with a 1D array is easier. I'll use the 2D array if that's...
  10. Replies
    14
    Views
    2,562

    i know i could use a two dimensional array but if...

    i know i could use a two dimensional array but if i could somehow combine it all into one big array it would be so much easier for me.
  11. Replies
    14
    Views
    2,562

    Can you merge arrays?

    i have a file that contains one thousand numbers
    73167176531330624919225119674426574742355349194934
    96983520312774506326239578318016984801869478851843...
  12. Replies
    2
    Views
    1,559

    Awesome, know I shouldn't really post on a thread...

    Awesome, know I shouldn't really post on a thread that's like a week old but need to say thanks. strlen() is what I'm talking about. Reason I didn't use it was because i didn't know about it.
    ...
  13. Replies
    7
    Views
    23,495

    Awesome, thanks for the help. I finished my...

    Awesome, thanks for the help. I finished my program that lists all the pairs of prime numbers whose sum equals the number entered by the user .

    just wondering on the memset


    #include...
  14. Replies
    7
    Views
    23,495

    yea that seems to be the problem when i did...

    yea that seems to be the problem when i did something like

    int array[5]={0}
    it would work but when i did something like

    int arraysize=5;
    int array[arraysize]={0}
    i would get that error...
  15. Replies
    7
    Views
    23,495

    Initialize multidimensional arrays to 0

    normally in a 1D array it would be something like

    int array[5]={0}
    and that would initialize all the values to 0 but when i try something like

    int array[5][5] = {0}
    i get an error that says...
  16. Replies
    1
    Views
    1,700

    Confused with following code

    char *str = "The quick brown fox jumped over the lazy dogs.";
    char *p;

    p = strstr(str, "lazy");
    printf("%s\n", p); // "lazy dogs."

    // p is NULL after this, since the string "wombat" isn't in...
  17. Replies
    2
    Views
    1,559

    Improvements for Palindrome

    Objective: Create a simple Palindrome checker program. The program should allow the user to enter a string and check whether the given string is a palindrome or not.

    My programming level is quite...
Results 1 to 17 of 17