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...
Type: Posts; User: k2712
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...
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...
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...
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...
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...
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...
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...
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,...
Wow, I am an idiot....
thanks
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. ...
Thank you Dave, that works perfectly.
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...
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...
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...
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...
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...