We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,680 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

sigsev error

this is the question.
www.codechef.com/problems/CTEAMS

i wrote this code
http://ideone.com/h5Gimy
it gives success but when i pass an input it gives sigsev error.please someone help!!

2
Contributors
2
Replies
11 Hours
Discussion Span
4 Months Ago
Last Updated
3
Views
mayankjain05_1
Newbie Poster
2 posts since Jan 2013
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0
scanf("%d", &t);

And

scanf("%d%d", &x[q][0], &x[q][1]);

Notice the ampersand (address-of operator). scanf() requires a pointer to an object, and you were passing some random number which was extremely unlikely to be a valid address in your address space.

deceptikon
Challenge Accepted
Administrator
3,505 posts since Jan 2012
Reputation Points: 824
Solved Threads: 481
Skill Endorsements: 58

i made some changes...http://ideone.com/m2j5GJ
but still problem output has some problem i guess..in codeblocks its giving the same answer but in ideone output is different..

mayankjain05_1
Newbie Poster
2 posts since Jan 2013
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page generated in 0.0813 seconds using 2.74MB