this is c code to find the kth largest element(character arrays if they are arranged in dictionary order) in the file but some wer the is a bug so it enters in to an infinite loop can any1 please check this ? thanks
@rsmith6559
@slotema
there is a problem with the passing strings..............to the sort function...... @slotema can u please check this one?
#include <stdlib.h> int main(int argc, char **argv) { int *iptr; char *cptr; #if defined(__GNUC__) # if defined(__i386__) /* Enable Alignment Checking on x86 */ __asm__("pushf\norl $0x40000,(%esp)\npopf"); # elif defined(__x86_64__) /* Enable Alignment Checking on x86_64 */ __asm__("pushf\norl $0x40000,(%rsp)\npopf"); # endif #endif /* malloc() always provides aligned memory */ cptr = malloc(sizeof(int) + 1); /* Increment the pointer by one, making it misaligned */ iptr = (int *) ++cptr; /* Dereference it as an int pointer, causing an unaligned access */ *iptr = 42; return 0; }
got thant
wat's this?
tazzzz a segment error
hmm dint find any solution for this but i guess i l work on it
the error is with the sort function so i thot it's better to include sort in make buckets
I've encountered no problems with sort nor an infinite loop. I keep getting a segmentation fault in findlarge, though
In findlarge, the variables tempL1 and tempR1 are never initialised, though they are used. Maybe that's what's causing the problem.
i l check that
Join our real-time social learning platform and learn together with your friends!