Search:

Type: Posts; User: k2712

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    1,648

    Typecasting and void pointers...

    I am currently working on an assignment that manages user's requests for memory. I are basically developing the procedures to replace malloc() and free(). I am supposed to maintain a free_list that...
  2. Replies
    10
    Views
    5,922

    You are right, I should have been using strchr(),...

    You are right, I should have been using strchr(), but I'm still not quite sure how to pass the integer value to strchr. I know a char is an 8-bit int, but I'm confused as to whether or not I need to...
  3. Replies
    10
    Views
    5,922

    What I need to do is if the user enters the...

    What I need to do is if the user enters the integer 65, I need to search the string named file for the ascii character A. If they enter 77, I search for M, etc... So what I need to know is how to...
  4. Replies
    10
    Views
    5,922

    strstr with integer

    Say I have a user enter an integer from 0 - 255, and I want to search an arbitrary string for all occurrences of the ASCII value of that integer. I've thought about typecasting, itoa, and creating a...
  5. Replies
    7
    Views
    1,319

    I'm reading the file with fgets to determine the...

    I'm reading the file with fgets to determine the length of the input file. Once that is determined I want to copy each byte from the input file into the input_file array with fread. Obviously this...
  6. Replies
    7
    Views
    1,319

    Thanks for the replies. Sorry for the simple...

    Thanks for the replies. Sorry for the simple mistakes, I'm still learning.

    This may be totally off, but I was thinking something like this might work, but if I try to print the string pointed...
  7. Replies
    7
    Views
    1,319

    Don't understand why this doesn't work. . .

    I'm basically wanting to read a file into a dynamically allocated array. This is the code I'm using to do this, but for some reason the do-while loop that uses fgets to read in the file line by line...
  8. Replies
    1
    Views
    3,484

    Large arrays, malloc, and strcmp

    I have two fairly large 2d arrays to hold strings, and I want to compare each string in the second array to every string in the first to see if any match. The following is how I create the arrays,...
  9. Replies
    2
    Views
    1,058

    Wow, I am an idiot.... thanks

    Wow, I am an idiot....

    thanks
  10. Replies
    2
    Views
    1,058

    Am I missing something? (2d arrays)

    Hi, as part of a larger program I need to create a list of random words(user defined, both the number of words and the length of each word), display the list, and then write valid words to a file. ...
  11. Replies
    2
    Views
    1,081

    Thank you Dave, that works perfectly.

    Thank you Dave, that works perfectly.
  12. Replies
    2
    Views
    1,081

    4 char's from one int. . .

    Say I have an unsigned int x = 0x4F726E67, and I want to print the character values of that int( 0x4F, 0x72, 0x6E, 0x67 ) becomes ( 'O', 'r', 'n', 'g' ) either to stdout or to a file. There must be...
  13. Replies
    2
    Views
    1,969

    Fix sprintf removing leading 0's

    I'm writing a homework assignment that requires me to convert various strings to ints and back. From the FAQ I'm using sprint and snprintf(as we're supposed to show various ways of doing this) to...
  14. Thank you both for your replies. sea_4_ever,...

    Thank you both for your replies. sea_4_ever, your suggestion worked, even if I'm not sure why.
    Salem, I'll have to look into your reply because I'm not familiar with sscanf, but if I understand...
  15. Sorry about that, about 2/3 of the way down...

    Sorry about that, about 2/3 of the way down you'll see the function "perform_menu_tasks" with a series of if, else if statements. The fgets is in the first if statement where program goes if the...
  16. Problems with fgets not accepting input from stdin

    Greetings,

    I've been tasked to create a menu driven program that accepts various inputs from the user and displays the data back to them. Relatively simple I'm sure but I'm having a problem with...
Results 1 to 16 of 16