No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
3 Posted Topics
[QUOTE=jephthah;878611]why so complicated? all you really need is "strtol()" and the addition operator. [code=c]int binaryAdd(char *first, char *second, int *sum) { int val1, val2; char *ptr1, *ptr2; size_t length; val1 = strtol(first,&ptr1,2); val2 = strtol(second,&ptr2,2); if (ptr1 == first || ptr2 == second) { printf("\ninvalid entry.\n\n"); return 0; } length …
Can anyone help me with my code?! I need to do a programm binary to decimal converter without using library, just stdio.h my code works wrong [CODE] void bin2dec(){ long int n; int s=1,j,p=1,i=0,x; int digit=1; printf("Input a binary number: "); scanf("%ld",&n); while(digit==1) { x=n%10; s=s+pow(2,i); i=i+1; n=n/10; if(n==0) digit=0; …
[QUOTE=MosaicFuneral;778328]They store it in binary yes, but we left the 8-bit addressing range many decades ago - even toys, and appliances have more than that! In the general computer market 32-bit is pretty standard, with a switch towards 64 becoming standard, soon.[/QUOTE] It seems like u're good in C=) So …
The End.
viwenka