Ask your own question, for FREE!
Computer Science 16 Online
OpenStudy (anonymous):

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

OpenStudy (anonymous):

OpenStudy (anonymous):

@rsmith6559

OpenStudy (anonymous):

@slotema

OpenStudy (anonymous):

there is a problem with the passing strings..............to the sort function...... @slotema can u please check this one?

OpenStudy (anonymous):

#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; }

OpenStudy (anonymous):

got thant

OpenStudy (anonymous):

wat's this?

OpenStudy (anonymous):

tazzzz a segment error

OpenStudy (anonymous):

hmm dint find any solution for this but i guess i l work on it

OpenStudy (anonymous):

the error is with the sort function so i thot it's better to include sort in make buckets

OpenStudy (anonymous):

I've encountered no problems with sort nor an infinite loop. I keep getting a segmentation fault in findlarge, though

OpenStudy (anonymous):

In findlarge, the variables tempL1 and tempR1 are never initialised, though they are used. Maybe that's what's causing the problem.

OpenStudy (anonymous):

i l check that

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!