c99tutorial,
that is to check size+indexwherecurrentelementiszero does not go out of bound of array length.
and 'size' is not the size of 'array', it is the size of pointer to the array where i...
Type: Posts; User: ymc1g11
c99tutorial,
that is to check size+indexwherecurrentelementiszero does not go out of bound of array length.
and 'size' is not the size of 'array', it is the size of pointer to the array where i...
Andreas,
No, what I want is the pointer. Here's my code:
int * mymalloc(int *array, int size){
int i = 0;
/*array is initialised with 0's
a non zero means the array at...
Hi c99tutorial,
Yea that was what I had been doing.
but what i wanted is: say i have an array of length 20 passed into my function. but then I wanted my function to return the location of,...
Hi,
found my solution not working again :/ so im trying to do it in ur way.
so i wrote my function as follow:
int *pointer;
int j;
for(j=0;j<size;j++) &pointer[j] = &array[j+size];
Hi Andreas,
I think the solution you provided requires me to use malloc for ptr first, which I should'nt be doing (I should have said this sorry).
Anyway, I got it working by using *pointer[],...
SAMARAS,
well actually i wasn't trying to find out the length of the array after the negative value.
i is actually the position where i want the pointer to point to.
By returning pointer,...
Hi SAMARAS,
is it possible to pass an explicit length of the array? for example the memory location from array[i] to array[i+size]?
Thanks in advance~!
Hi all,
i passed an array of integer
int myarr[10];
into a function like this:
Hey all~
I am writing a function which takes an array as parameter and returns the pointer to the part of the array which had not yet been written with negative values. In the beginning I had...
Hi Andreas,
With your advice, the problem is sorted. :D
But I have a few questions:
Here is how my sortwords looks like:
int storewords(char **warr, char *w){ int wc = 0;
char **buffer =...
I have this function which convert all alphabets of a given string into lower case:
void to_lower(char *input, char *output){ unsigned int i, j;
for (i = 0, j = 0; input[i] != '\0'; i++) {
if...
sorted! cheers!
sorted! cheers! :D
sorry i just cant get my head round it as a beginner
so i should declare it in my main as this:
struct tnode *root;
and in my method sort,
-how do i check if the 'root' had been assigned...
laserlight,
here's the struct i created:
struct tnode {
char *word;
int count;
struct tnode *left;
struct tnode *right;
Hi qny,
When I tried to do that, it gave me "invalid operand to binary ==" error..
Hi everyone,
I want to initialize my struct with a null value, and at some point check whether the struct is null.
struct mystruct s = {0};
and then when i need to check it:
Hi,
I am writing a program that takes input fr stdin, breaks it into tokens of words, and then count the occurrence of the each word by sorting them into a tree of struct.
however when i tried...