a good question and i thought hard on this, coming up on one conclusion. "I don't give a fuck." now this isn't just some smart remark. follow me on this nah....
confidence or cockiness, i know who i am. i know what i can do. i know what i'm good at and i know what is beyond my understanding. i know where i'm the shit and i know that my shit can stank. and i keep it realistic. not really caring how it's seen from others point of view, but respecting their view still. and moving on.
i've got a very complex understanding of confidence, but i'm going to keep the thread going. but it's more than just walking up to some broad or not being shy.
now cocky is just a plain ol ass whole that can't back they're own shit up. and even if you did, the fact that you're such an asshole about it makes people still see you in an ill light. no matter how good you are. so they call you cocky... might be different for other folks cultures, regions, or whatever.