Guess so... how come will that happen?
Type: Posts; User: ljin
Guess so... how come will that happen?
it still wont work.
When I start to run my code, it will stop anyway, why? Thanks for any help!
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
typedef struct _list_item {
int value;
I doubt you solved the problem correctly. Assume BLOCK_SIZE = 3, the average should be 3/1 = 3. Why adding the value of the bytes and dividing them by 3. It should be adding the number of the bytes...
I think you are right. here is a piece of my code for this implementation. Any comment?
unsigned char average(const char *filename){
unsigned int BLOCK_SIZE=512;
unsigned int nlen=0,...
Sorry, that's all what I have. I was asked to implement the function which calculates an average of all bytes in a given file shown in the first post. I dont know what is "average" meaning for either.
I could get the size of the file in bytes using the function ftell(). I dont know what is an average of all bytes in the file. Thanks for any help! Here is a piece of code:
unsigned char...
Thanks sean and tabstop!
It does make more sense for me now.
sptr get_s_ptr(int *a_ptr)
{
sptr ptr;
Thanks guys!
Here is my new trial:
typedef struct s* sptr;
struct s{
Yes, you pointed out what I am thinking now. One thing is that how I could "move the whole struct to that location of member a within a struct" passed by the pointer. Is it possible to do that?...
Thank you for reminding me of this.
I tried to solve this question, however I dont fully understand why the parameter of function is a pointer to member of the struct and return a pointer to the...
Given a pointer to member a within a struct, write a routine that returns a pointer to the struct.
struct s
{
...
int a;
…
};