Haha, thanks :D , but forgetting to free my memory is a big mistake! Bravo for your observation ;)
So right before return 0; (where main terminates at these two lines of code)
for(i = 0 ; i...
Type: Posts; User: std10093
Haha, thanks :D , but forgetting to free my memory is a big mistake! Bravo for your observation ;)
So right before return 0; (where main terminates at these two lines of code)
for(i = 0 ; i...
For a goodnight post let me argue with myself for this comment
/* This is not necessairy.Can you see why? */
pivot += i;
Actually it is necessairy.
I will prove...
Ok here is my approach
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
void initstrFound(char* array , int n ,char* searchStr)
{
You are checking the wrong value i would say :)
for(array_ctr = 0; ctr < data[0].x; array_ctr++)
printf("%s\n", data[array_ctr].string1);
This should be array_ctr maybe... Try this...
I would also like to point out that before entering the loop, memory is allocated for string2.Then string1 is copied into string2.
Then the loop will get into the if body and realloc string2 into...