Can someone please help me with Binary Addtion. Programming Software Development by lulug76 …;"- "; //To place a - in the binary display for readablity. num+=4; //To increment by 4 so it shows up… Re: Can someone please help me with Binary Addtion. Programming Software Development by dubeyprateek …;"- "; //To place a - in the binary display for readablity. num+=4; //To increment by 4 so it shows up… Re: Can someone please help me with Binary Addtion. Programming Software Development by dubeyprateek …;"- "; //To place a - in the binary display for readablity. num+=4; //To increment by 4 so it shows up… String Selection Sort with files Programming Software Development by db132074 … names showArray( names, NUM_NAMES ); selectionSort( names, NUM_NAMES ); //clear screen for readablity system("cls"); //show sorted names cout<<… Compilers: Are variables stored i RAM when no calculations are made? Programming Computer Science by Bladtman242 …;, 5)[/ICODE] is more accurate) If not, one might balance readablity/maintainability against performance (small improvement perhaps, but I'm a… Re: Compilers: Are variables stored i RAM when no calculations are made? Programming Computer Science by Narue …;, 5)[/ICODE] is more accurate) If not, one might balance readablity/maintainability against performance (small improvement perhaps, but I'm a… Re: C++ Performance Tips Programming Software Development by bsrivastava … to go thru technique like vtable. Advantages of virtual functions - Readablity - No Need to change existing code for incrementing functionalities in… Re: Suggestions for perl resources? Dealing with csv data. Programming Software Development by Comatose Right, I just did that for the readablity issue. I probably would have done the first suggestion, and just assigned scalars to the initial split. Re: Syntax error in FROM clause. Programming Software Development by jbennet please in future use [code] tags around your code for readablity Re: count checkboxes Programming Web Development by wilch To optimise your code for readablity, and avoiding boredom of scrolling down - like i experienced. Replace … Re: count checkboxes Programming Web Development by digital-ether [QUOTE=wilch;996315]To optimise your code for readablity, and avoiding boredom of scrolling down - like i experienced. Replace … Re: PHP MySQL database query using variable passed in hyperlink query string Programming Web Development by smantscheff You can, if you assign the variables first. And for readablity I think it's easier to integrate the variables in … Re: setters, getters and input from file Programming Software Development by T-Dogg3030 … and setting the money variable. You should always strive for readablity in your code. The line below looks for the next… Re: Can someone please help me with Binary Addtion. Programming Software Development by dubeyprateek your code is too long, better if u mark in ur code the problem area. Re: Can someone please help me with Binary Addtion. Programming Software Development by lulug76 Ok sorry didn't realize how long my code was. I can fiqure out why my binAddCal function is not working it is the last funtion in the code. Thanks Re: Can someone please help me with Binary Addtion. Programming Software Development by Lerner I asssume you meant you can't fiqure out why my binAddCal function is not working. Assuming that's the case, here's how I'd Given: Usually we write numerical values with largest placeholder to the left and lowest to the right. However, that is convention only. It could be the other way around just as easily. And: One of the more common … Re: Can someone please help me with Binary Addtion. Programming Software Development by Bench This sort of boolean arithmetic is probably simplest with a recursive algorithm. for the integers, a and b.. Take a temporary 'carrier' number which records the result of [INLINECODE]a AND b[/INLINECODE] bit-shifted one place left. if the carrier evaluates to zero, the result of the calculation becomes [INLINECODE]a XOR b[/INLINECODE] … Re: Can someone please help me with Binary Addtion. Programming Software Development by Bench Incidentally, C++ has an STL container called a bitset - it might be better to use that than a vector of int's or bool's or whatever. Bitsets are designed with binary operations in mind :) Re: Can someone please help me with Binary Addtion. Programming Software Development by lulug76 Thanks for all of your input, I have to use vectors as part of the problem. My problem is I can't figure out why the vector isn't being passed to the function. I the vectors as agruments of the function but it keeps saying the size is zero and I don't know why. Re: Can someone please help me with Binary Addtion. Programming Software Development by iamthwee er that's wrong. I tried it with 23 and 34...didn't work. Tee he he. Try again [URL=http://imageshack.us][IMG]http://img476.imageshack.us/img476/5171/cut20ln.png[/IMG][/URL] [B][COLOR=Black]Pi[COLOR=RoyalBlue]world[/COLOR] ™[/COLOR][/B] [COLOR=RoyalBlue][[/COLOR][COLOR=DimGray]Tis simple as Pie[/COLOR][COLOR=RoyalBlue]][/COLOR] Re: Can someone please help me with Binary Addtion. Programming Software Development by Bench If you have to use vectors for this (Wouldn't be my first choice, a deque would to allow you to use push_front - eliminating the annoying step of reversing the bit order), rather than vector<int> - you are only holding 1s and 0s, so use vector<bool> - this could simplify your code a fair bit. You could also reduce alot of repeated … Re: Can someone please help me with Binary Addtion. Programming Software Development by iamthwee It's not his homework - and it's wrong anyway. :rolleyes: Nice one dubeyprateek. Please tell me you don't really work for a software development company. Yikes. Tee he he. Have a look here. It might even give you ideas about implementing two's complement. http://en.wikipedia.org/wiki/Two's_complement [URL=http://imageshack.us][IMG]… Re: Can someone please help me with Binary Addtion. Programming Software Development by iamthwee >i guess i hav helped him more thn wat u are doing by giving some links. Wrong! Doing his homework is far from helping. I pitty whoever you work for. :) Seriously. Tee he he. ThanQ [URL=http://imageshack.us][IMG]http://img476.imageshack.us/img476/5171/cut20ln.png[/IMG][/URL] [B][COLOR=Black]Pi[COLOR=RoyalBlue]world[/COLOR] ™[/… Re: Can someone please help me with Binary Addtion. Programming Software Development by dubeyprateek >>>Wrong! Doing his homework is far from helping. help shoul worth something dear, just saying tat do this or do tha does not make any sence. >>>I pitty whoever you work for. Yeah u can, but interesting is they feel proud on me.. he he he..! Re: Can someone please help me with Binary Addtion. Programming Software Development by iamthwee >just saying tat do this or do tha does not make any sence So what you are effectively saying is that the only way to explain something is to provide the entire code? How then does that help the person coding? The answer is of course it doesn't. Offering advice, a link or even a small sample snippet will be a thousand times more productive… Re: Can someone please help me with Binary Addtion. Programming Software Development by dubeyprateek >> How then does that help the person coding? The answer is of course it doesn't. Offering advice, a link or even a small sample snippet will be a thousand times more productive than what you are doing right now. what should be offered can not be determined by a rule or FACTs, it entirely depends on the requirement. i felt my code will … Re: String Selection Sort with files Programming Software Development by NathanOliver could you please post your code for your showArray() function. it looks like the problem will be in there. Re: String Selection Sort with files Programming Software Development by db132074 [QUOTE=NathanOliver;1125033]could you please post your code for your showArray() function. it looks like the problem will be in there.[/QUOTE] [CODE]void showArray( string names[], int NUM_NAMES ) { for(int count= 0; count<NUM_NAMES; count++) cout << names[count] << endl; system("pause"); … Re: String Selection Sort with files Programming Software Development by NathanOliver alright the problem is you are using endl after each name so it wil display each name on a seperate line. if you want to displa it as Last, First then this should work well for you. [code=c++] void showArray( string names[], int NUM_NAMES ) { for(int count= 0; count<NUM_NAMES; count+=2) { cout << names[count] << … Re: String Selection Sort with files Programming Software Development by db132074 Thanks, that got me most of the way there. I had to change NUM_NAMES from 20 to 40 to display all the names I had. Now that that's fixed, my selection sort is sorting screwy. I'm going to try to get on my own though. Thanks again.