A
ash
hi friends,
i have some questions whch is in my last year question papers.i need
some help to get logic of these questions.
1) write a C function, that takes two strings as arguments and returns
a pointer to the first occurrence of 1st string in 2nd string or NULL
if it is not present.
-- i tried to solve it but it seems that i am not understanding this
question at all.i am taking this question as:
1st string- "cat"
2nd string-"i like cat."
i have to return pointer that has strarting address of 'c' of cat of
2nd string.i can make a program ( that finds a string into another )
but how to return pointer of that string i don`t know.
please suggest some advice.
2) write a 'C' function
char **readAndcreate(int n)
the function reads "n" strings from the input and creates a list of
such strings dynamically using "malloc" library call.
-- as well as i understand i have to make a linked list that will hold
the strings(i can make it )but one thing i didn`t understand what this
function will return, Address of first node of that list or something
else.if yes please describe how?
my english is not good but i think you have understood my problems.if
anyone can suggest a good link related to my problems, i will be
thankful.
thankx in advance
i have some questions whch is in my last year question papers.i need
some help to get logic of these questions.
1) write a C function, that takes two strings as arguments and returns
a pointer to the first occurrence of 1st string in 2nd string or NULL
if it is not present.
-- i tried to solve it but it seems that i am not understanding this
question at all.i am taking this question as:
1st string- "cat"
2nd string-"i like cat."
i have to return pointer that has strarting address of 'c' of cat of
2nd string.i can make a program ( that finds a string into another )
but how to return pointer of that string i don`t know.
please suggest some advice.
2) write a 'C' function
char **readAndcreate(int n)
the function reads "n" strings from the input and creates a list of
such strings dynamically using "malloc" library call.
-- as well as i understand i have to make a linked list that will hold
the strings(i can make it )but one thing i didn`t understand what this
function will return, Address of first node of that list or something
else.if yes please describe how?
my english is not good but i think you have understood my problems.if
anyone can suggest a good link related to my problems, i will be
thankful.
thankx in advance