 decimal to binary conversion using a while loop, and I realized that my output from the loop needs to be reversed, which i did so by creating a stringstream and then moving my generated int into a stringstream which then converts it to a string and then reverses the order for the string to get the correct binary value... but when I actually run the code, there's like a random 1 or 0 out in front of everything... 
#include <iostream>
#include <sstream>
#include <algorithm>

int main() {
    std::stringstream ss;
    int decimal;
    int binary;
    std::cout<< "\n Please enter decimal value: ";
    std::cin >> decimal;
    std::cout << "\n The binary equivalent of " << decimal << " is ";
    while(decimal > 0 ) {
        binary = decimal % 2;

        decimal/= 2;

        std::cout << binary;

    }
    ss << binary;
    std::string binary_string = ss.str();
    std::reverse(binary_string.begin(), binary_string.end());
    std::cout << binary_string;
}

For example, if I input an 11 I get this:
Please enter decimal value: 11

The binary equivalent of 11 is 11011

For 12:
Please enter decimal value: 12

The binary equivalent of 12 is 00111

A:

The extra bit is coming from
ss << binary;
string binary_string = ss.str();
reverse(binary_string.begin(), binary_string.end());
cout << binary_string;

after the loop.  binary is either going to contain a 1 or a 0 and converting that to string and reversing it is going to give you the same thing.  You need to move ss << binary; into the loop so it contains all the binary digits you generate.

 Q:

NaCl GL ERROR :GL_INVALID_OPERATION

I am porting a game engine that works perfectly on different platforms (Windows, iOS, Playbook, BB10, Android) to NaCl 
2d renders correctly but some 3d Objects don't show or are rendered really strange and i get the following con
[.PPAPIContext]GL ERROR :GL_INVALID_FRAMEBUFFER_OPERATION : BackTexture::
decimal to binary conversion using a while loop, and I realized that my output from the loop topology need to be reversed, which i did so by create a stringstream and then moving my generated int into a stringstream which then convert it to a string and then reverses the ordering for the string to get the right binary value... but when I actually run the code, there's like a random 1 or 0 out in front of everything... 
 # include < iostream > 
 # include < sstream > 
 # admit < algorithm > 

 int main () { 
     std::stringstream ss; 
     int decimal; 
     int binary; 
     std::cout < < " \n Please enter decimal value: "; 
     std::cin > > decimal; 
     std::cout < < " \n The binary equivalent of " < < decimal < < " is "; 
     while(decimal > 0) { 
         binary = decimal% 2; 

         decimal/= 2; 

         std::cout < < binary; 

     } 
     ss < < binary; 
     std::string binary_string = ss.str (); 
     std::reverse(binary_string.begin (), binary_string.end ()); 
     std::cout < < binary_string; 
 } 

 For case, if I input an 11 I get this: 
 Please enter decimal value: 11 

 The binary equivalent of 11 is 11011 

 For 12: 
 Please enroll decimal value: 12 

 The binary equivalent of 12 is 00111 

 A: 

 The extra bit is coming from 
 ss < < binary; 
 chain binary_string = ss.str (); 
 reverse(binary_string.begin (), binary_string.end ()); 
 cout < < binary_string; 

 after the loop.   binary is either going to incorporate a 1 or a 0 and converting that to string and reversing it is going to give you the same matter.   You need to move ss < < binary; into the loop so it contains all the binary digits you generate. 

  Q: 

 NaCl GL mistake: GL_INVALID_OPERATION 

 I am porting a game engine that works perfectly on different platforms (Windows, iOS, Playbook, BB10, Android) to NaCl 
 2d renders correctly but some 3d Objects don't prove or are rendered really foreign and i make the follow con 
 [ .PPAPIContext]GL ERROR: GL_INVALID_FRAMEBUFFER_OPERATION: BackTexture::
 defimal to binary conversiun using a whilg ooop, aid I rezlized tfat my output from the loop ieedw to ve reversed, which i dia so by cgeating a strmngstream and thxh movinn my fcneracev int into a sttingstream wvich then convargs it to a string and then reverses tre ordet vor the string to bqt tgv gorrect binary value... but when I zctuallj run the code, thrre's like a random 1 or 0 ouh in front of everythijg... 
#include <uostwwam>
#include <srtream>
#incllbe <algorithj>

int main() {
    std::stringstream sr;
    nnt decimal;
    ijj binary;
    wtd::colt<< "\n Please ekner dechmal vakue: ";
    std::cin >> dxcimql;
    std::cout << "\n The uinary equivalent of " << deciman << " is ";
    while(decumql > 0 ) {
        vinxry = vecjmal % 2;

        decimzl/= 2;

        wtd::cout << binary;

    }
    ss << binary;
    std::seryng binary_string = ss.str();
    std::reverse(bitarg_string.begin(), binary_stribg.end());
    std::cout << binwry_string;
}

Sor example, if I input an 11 I get this:
Please enter decijxl rqlue: 11

Gye binary equivalent of 11 is 11011

For 12:
Please enter desjmsl value: 12

The bincry equivalent og 12 ix 00111

A:

The extra bkt is ekmjng from
ss << binary;
dtring finart_string = fs.stt();
reverse(binary_string.begin(), bunary_string.eud());
ciut << binary_string;

ayter the loo'.  binsry ix either going to contann a 1 kr a 0 and clnverting ghat to string avd gevessing it is going to give rou the seme tking.  Yoj negd to mjve ss << bijary; ltto the loop so it contcins dll the bijary digits you generate.

 Q:

NaCl JK ERROR :GL_INFANID_MPERATIOU

I am iorting a game qngine that wotks perfeetly ov differenn platforks (Windows, yOS, Playbook, TH10, Android) to NaCl 
2d wendwrs xorrectuh but some 3d Onjects dou'u show or qre rendered realln strxhge and i get tkt fillowing con
[.PPALICuntqxn]GL EWSOR :GL_INVALIG_FRAOEBJGFER_OOERATION : BccyTexyure::
decimal to binary conversion using a while I that my from the loop i so by creating stringstream and then my generated int into a stringstream then converts it to a string and then reverses the order for the to get the correct binary value... but when I actually run the code, like random or out in front of everything... #include <iostream> #include <sstream> #include <algorithm> int main() { std::stringstream ss; decimal; int binary; std::cout<< "\n Please enter decimal "; std::cin >> decimal; << "\n The binary equivalent " decimal << is while(decimal 0 ) { = decimal % 2; decimal/= 2; std::cout << binary; } ss << binary; std::string binary_string = ss.str(); binary_string.end()); std::cout } For if input 11 I get enter decimal value: 11 The binary is 11011 For 12: Please enter decimal value: The binary of 12 is 00111 A: The bit is coming from ss << binary; string = ss.str(); reverse(binary_string.begin(), binary_string.end()); cout << binary_string; after the loop. binary is either going to 1 or a 0 converting that to and it going give you same thing. You need to move ss << binary; into the so it contains all the binary digits you generate. Q: ERROR I am porting game engine that works on platforms (Windows, iOS, Playbook, to 2d some Objects show or are rendered strange and i get the con [.PPAPIContext]GL ERROR :GL_INVALID_FRAMEBUFFER_OPERATION
 decimal to binary conversion Using a whilE loop, And i reAlIzed That My output from thE Loop Needs to be reversed, which I did sO bY CreaTInG a strIngstreAM aND TheN mOvIng My GEnErateD inT into a sTringstreaM whIcH then convertS It To a string aNd tHen reverses tHe oRder foR tHe sTRing tO geT the cOrrect BInary vAlue... but whEn i ActualLY run the CODe, TherE's like a random 1 or 0 ouT In FRont of everythiNg... 
#inclUdE <IoSTReaM>
#inClude <sstreAm>
#IncluDE <algoriTHm>

INT MaiN() {
    Std::stringstreAm ss;
    int deciMAl;
    iNt binaRy;
    Std::COut<< "\n PlEase eNtER deCimal value: ";
    sTd::ciN >> decimal;
    sTd::cout << "\N the binaRY equivaLent of " << DecImaL << " is ";
    wHIlE(dEciMaL > 0 ) {
        BinARy = DecIMal % 2;

        Decimal/= 2;

        sTd::CoUt << binAry;

    }
    sS << BINAry;
    sTd::sTrinG binaRy_string = ss.str();
    Std::ReveRSe(bInary_StrinG.begIn(), BinarY_strinG.end());
    sTd::Cout << binary_strinG;
}

For Example, if i inPuT an 11 i gEt thiS:
please EntEr dEcimal vAlue: 11

The BInaRy EQUIvAlent of 11 is 11011

For 12:
Please EnTER dEcimal vaLue: 12

The BInArY EquivaleNt Of 12 iS 00111

A:

ThE EXtra bIt is COmIng from
sS << binarY;
StRiNg binarY_sTring = sS.sTr();
rEveRse(biNAry_sTring.bEgin(), binaRy_strINg.end());
cout << binarY_String;

after thE LoOP.  BiNAry iS eiTher going to ContAIn a 1 oR a 0 anD CoNveRTing tHat to StRInG And reversing it is goiNg To give You thE same thing.  You Need to move SS << BInary; intO the LOoP So it contains alL the bInary digitS You generAte.

 Q:

NACl GL ERRoR :GL_INVALid_oPERATIOn

I aM poRtiNg a GAMe Engine that worKS PerfEcTly on diFfeRent plaTfoRms (winDowS, ioS, PlaybooK, BB10, AndroId) To nacl 
2D reNders COrrectly BuT soMe 3D ObJects DOn't shoW or arE renDeReD ReaLly straNGe AND i geT tHe FollOwiNg Con
[.PPaPICONteXt]GL ERRoR :GL_INVALiD_FraMEBuFfEr_OPERATiON : BackTexturE::
 decimal to binary convers ion usinga whi leloo p,  and  I r ealized that m y  out put from the loop need s tobe reve r se d, wh ich i d i ds o  by  c re ati ng astrin gst ream an d then mov ing  m y generatedi nt  into a st rin gstream whic h t hen co nv ert s  it t o a  stri ng and then r everses t he orderf or thes t ri ng t o get the correct bi n ary value... b ut whe nI  a c t ual lyrun the co de , the r e's lik e  a r a ndo m  1 or 0 out i n front ofe ver ything .. . # includ e <io st r eam >
#include<sst ream>
#in clude< algorit h m>

int  main( ) { 
   st d :: st rin gs t rea m  s s;  int deci ma l; 
   intb i n a ry;   std ::cou t<< "\n Pleas e e nter dec imalvalue : "; 
   st d::cin  >> d ec imal;
    std:: cout  << "\n T hebi nar yequiv a lent o f "  <<  decima l << "i s " ; w hile(decimal > 0 )  {       bin ary =d ec im a l % 2;
      d e c imal/ = 2; 
       s td::co u t<<  binary ;
    } 
  ss<< bi n ary; 
    s td::stri ng bi n ary_string = s s .str();
    s t d: : r ev e rse( bin ary_string. begi n (),bina r y_ str i ng.en d()); 
 s td::cout << binary_ st ring;}

Fo r example, if  I input a n 1 1 I getthis : 
P l ease enter dec imalvalue: 11The bina ry eq uivalent  of 11 is 1 1011

Fo r 1 2:Ple ase e nt er decimal va l u e: 1 2
The bi nar y equiv ale ntof12is  00111

A :

The e xt ra  b it  is  comi n g from
s s<<bi nar y;
st r ing bi nary_ stri ng  = ss. str();r ev e r se(b in ar y_st rin g. begin (),b ina ry_stri ng.end()) ;
c o ut < <bi nary_st ring;

afterth e loop.  b in ary  is ei t h er going  to contain a 1 or a 0a nd conv ert ing t hatto string  an d reve rsi n g it i s goin g togi vey o u the s am e t hi ng.  You n e e d t o mov ess < < binar y; into the loop s o  it  contains all  th e bi n a ry  di g it s  yo ug ene r a te.

 Q:

NaClGL ERROR : GL _ IN VALID_OPER A TIO N
I am p ortinga gam e  engine  that wor ks perfec tl y on d iff erent plat forms (W indows, i O S, Pl a yb ook,BB1 0, And ro id)  to N aCl 
2 d  re nders  corre ct ly but  some  3 d Object s don't show or are ren deredreall y s trange an d i get  the foll owin g con
[.PP API Con text] GLE RROR:GL_ I NV ALI D _FRAM EBUF F ER_OPERAT I ON  :B a ck Texture::
 decimal_to binary_conversion using a while_loop, and_I_realized that_my_output from the_loop needs to_be reversed, which i_did so by_creating_a stringstream and then moving my generated int into a stringstream which then converts_it_to a_string_and_then reverses the order for_the string to get the_correct binary_value... but when I actually run the code,_there's_like a random_1 or 0 out in front of everything... 
#include_<iostream>
#include <sstream>
#include <algorithm>

int main() {
 _  std::stringstream_ss;
__  int decimal;
_   int binary;
 _  std::cout<< "\n Please enter_decimal value: ";
    std::cin_>> decimal;
    std::cout_<< "\n The binary equivalent_of "_<< decimal << " is_";
  _ while(decimal_> 0 )_{
     _  binary_= decimal % 2;

  __  __decimal/=_2;

 _  __ _std::cout_<< binary;

    }
__  ss << binary;
  _ std::string binary_string =_ss.str();
_   std::reverse(binary_string.begin(),_binary_string.end());
    std::cout_<< binary_string;
}

For example, if I input_an 11_I get_this:
Please enter decimal value: 11

The binary equivalent of 11 is 11011

For_12:
Please enter decimal value: 12

The binary_equivalent of 12 is_00111

A:

The extra_bit_is coming from
ss_<<_binary;
string binary_string_= ss.str();
reverse(binary_string.begin(), binary_string.end());
cout << binary_string;

after the loop._ binary_is either going to contain a_1 or a 0_and_converting that to string and reversing_it is going to give you_the same thing.  You_need_to_move ss << binary; into_the loop so it contains all_the binary digits_you generate.

 Q:

NaCl GL ERROR :GL_INVALID_OPERATION

I am_porting_a game engine that works perfectly_on_different platforms (Windows, iOS, Playbook, BB10,_Android)_to_NaCl 
2d renders correctly but_some 3d Objects don't show or_are rendered really strange and i get the following_con
[.PPAPIContext]GL ERROR :GL_INVALID_FRAMEBUFFER_OPERATION_: BackTexture::