d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Returning A Char Class Problem > *need Help It's Due At 12*
Prev12
Add Reply New Topic New Poll
Member
Posts: 23,862
Joined: Aug 16 2006
Gold: 20.00
Mar 17 2013 02:17am
Quote (AbDuCt @ Mar 17 2013 01:35am)
second quote i told him how to fix his code (notice the varname++? well thats exactly what he needed to do to keep track of his correct answers and then he proceeded to post silly questions. in the end he did it like i said anyways) and he ignored it like every other post people gave him on how to fix his problems, because the kid wants direct code fixes and expects us to debug and post back working code. i as well of others have gave him solid advice on how to fix his code but he forever seeks to do it his way and then asks again for help when it doesnt work.

third quote is you being retarded. malloc and free is the same concept as new and delete, which is used in c++ so your excuse of "i dont work with c enough" is void... so if you do not know what you are talking about then dont post. how often do you see me post in a thread if i dont try to offer concrete ways to fix things. in that thread i told him to run the application in a debugger with the binary compiled with the -g flag and check to make sure the addresses are what they are supposed to be.  in that same post you go talking about freeing memory and such then at the end "uh yea i dont actually know c cuz im no master so i dont actually know what im talking about"

what does fourth quote have to do with anything?

if you would of read my reply you would also have noticed i told him how to fix his string error. please reply back this is mildly entertaining.

edit:: notice how i only tell you that you are a stupid kid while everyone else seems to get nothing on complements from me? well... thats because they actually know what they are talking about and dont post stupid shit like "well uh i think uh your loop is not looping and uh yea thats me own uh observation" (mimic of eep please dont make me go back through posts to find lots of examples where you make stupid comments like this. hell theres one in this topic.)


So, again, you think its okay to call people retarded when 1) you help them or 2) they didn't do something you agree with.

Was just checking to make sure.

Quote
thats because they actually know what they are talking about and dont post stupid shit like "well uh i think uh your loop is not looping and uh yea thats me own uh observation" (mimic of eep please dont make me go back through posts to find lots of examples where you make stupid comments like this. hell theres one in this topic.)


The problem here is you THINK you are a good reference or something. You might know the material, but you can't convey it the way a normal, decent human being does. I haven't, EVER in a long time, made a suggestion which would directly affect someones code. In the C thread, I was trying to get across that drawing a picture helps when dealing with pointers, and that possibly he might not have freed something. Obviously, that wasn't the problem. No code was changed and zero harm was done. There was a java thread awhile back where someone didn't initialize something. That is about the only snippet of code I have posted for someone in a long time, if ever.

Yet you come in a thread, proceed to belittle everything you can and then expect people to take your shit because you might have the right answer.

Also, you keep saying 'stupid kid' this and stupid kid that. You don't know ANYTHING about me, so stop acting like you do please. Thanks!

(And for the record, your knowledge of CS does not make you a more intelligent person than me or anyone else. You should really stop thinking that.)

This post was edited by Eep on Mar 17 2013 02:17am
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Mar 17 2013 11:33am
Quote (Eep @ Mar 17 2013 04:17am)
So, again, you think its okay to call people retarded when 1) you help them or 2) they didn't do something you agree with.

Was just checking to make sure.



The problem here is you THINK you are a good reference or something. You might know the material, but you can't convey it the way a normal, decent human being does. I haven't, EVER in a long time, made a suggestion which would directly affect someones code. In the C thread, I was trying to get across that drawing a picture helps when dealing with pointers, and that possibly he might not have freed something. Obviously, that wasn't the problem. No code was changed and zero harm was done. There was a java thread awhile back where someone didn't initialize something. That is about the only snippet of code I have posted for someone in a long time, if ever.

Yet you come in a thread, proceed to belittle everything you can and then expect people to take your shit because you might have the right answer.

Also, you keep saying 'stupid kid' this and stupid kid that. You don't know ANYTHING about me, so stop acting like you do please. Thanks!

(And for the record, your knowledge of CS does not make you a more intelligent person than me or anyone else. You should really stop thinking that.)


i think anyone has the right to call another retarded when they make 10 posts and ignore everyones advice in the 10 posts then proceed to ask for further help with direct code modifications.

and for the record, my knowledge of CS does make me more intelligent in the CS category than you. i can convey their code, find the problem, and offer a solution while you just go "yea i dont understand why you do dis but me dun know i jus observations"
Member
Posts: 2,757
Joined: Nov 26 2007
Gold: 1,214.81
Mar 20 2013 07:45am
You can only get strings with next() function. So you have to take a string then just take whatever the first character was.

So if they type +asdsaf, only + is returned.

You could also look for the first character that's an operation and return it.

Fixed it so it will only take an operation or 'q'.

Code
char getOperator( ) {
   while ( true ) {
     System.out.println( "Enter operation: + - * / q (q ==> quit) : " );
     char operation = new Scanner( System.in ).next( ).charAt( 0 );
     if ( operation == 'q' ) {
       System.exit( 0 );
       return operation;
     } else if(operation=='+'||operation=='-'||operation=='*'||operation=='/') {
       return operation;
     } else{
       System.out.println("That's an invalid operation");
     }
   }
 }


This post was edited by labatymo on Mar 20 2013 08:02am
Go Back To Programming & Development Topic List
Prev12
Add Reply New Topic New Poll