If I'm not mistaken fgetc() reads the character currently indicated by the internal file position indicator of the particular file pointer (fp).
fgets() will stop reading the when either (n-1)...
Type: Posts; User: snoopfrogg
If I'm not mistaken fgetc() reads the character currently indicated by the internal file position indicator of the particular file pointer (fp).
fgets() will stop reading the when either (n-1)...
Thank you!
Ah, thanks, now I'm getting the proper output. Do you mind explaining why that kept happening?
I'm working on a simple program that maintains parts in a database. The program tracks parts stored in a warehouse. Information about the parts is stored in an array of structures. The program is...
You don't need the for loop or getchar() in your main function.
Your bstSort function is incorrect.
You don't increment the position of the array when storing the inorder traversal in arr
...
Your first post states:
/*
Destroys the binary tree structure by doing an inorder traversal
and frees the dynamically allocated memory of each node.
*/
void bstDestroy(struct Node...
I just realized the function doesn't call itself... lol, my b.
Are inline functions always recursive?
She actually gives us a shell script to make sure it passes those conditions, and they do.
Thanks for the feedback. I really appreciate it. What's the best way to avoid referencing garbage in my case? The program works for the test cases I was given, but I'd rather not practice bad...
Do you mind explaining this, please?
I figured it out! I believe my assumption about my if statement being the problem was correct!
Here's what my code looks like now:
#include <stdio.h>
#include <stdlib.h>
#define SIZE...
I tried using a while loop in the replaced function to see if that would produce the same output. With that being said, my output is incorrect.
If I input defendddd, the output is defend3ddd...
Would it be easier for me to use a while loop in this situation?
I incremented the str and replaced pointers but I still can figure out how to fix my for loop. All the expected outputs are correct, but I would like to eliminate the loop index to get the same...
is tmp declared as a char *tmp? I know what you posted was psuedo code. I'm just trying to make sense of it.
I am working on a program that ask the following:
Write a program that replace repeated three characters in a string by the character followed by 3. For example, the string aabccccaaabbbbcc would...
Wouldn't it be easier to use a for loop in this situation? Wouldn't the while loop run indefinitely if you don't initialize the count i?
For example:
#include <stdio.h>
#include <math.h>
...
Thanks!
Now I see what Salem meant by the arrays a mirrored in both halves of the array. Thank you.
So *p just gets assigned to *q which would be N-1 elements and *q gets assigned *p which would be the first element of the array?
Can you explain please?
I'm having a bit of trouble understanding pointers and arrays. As well as pointer arithmetic. The problem is as follows:
What will be the contents of the a array after following statements are...
Thanks for the advice.
I finally figured it out. I created a search function to make sure I'm not copying any duplicated element into array 3. It searches through the elements in array 3 and inserts elements the elements...
That's weird... I ran the test inputs you posted and this the output I got
15653
I'm a bit confused on what I need to do to make it run properly. Do you mind explaining to me what I should do?...