Yeah but it has to read any odd number and be able to know how to write the string accordingly.
Type: Posts; User: Once-ler
Yeah but it has to read any odd number and be able to know how to write the string accordingly.
64 bit unsigned integer is to be encoded to a string
binary
I am trying to read in a file
encode every odd number to a char[8](64 bit)
and write it to another file
At first I was going to have every number that started at the maximum value of every odd unsigned long long converting it into a char array up until the value was 0 or close to it. To do it with if...
I am writing it out as you said.
I am not a trolling, I am merely a beginner trying to understand enough to write my program. I am currently reading/practicing Deitel C how to program and after that...
my examples are wrong it should skip every 0-5 except the unused ones at the left side of the array. Example 0,0,0,0,0,0,0,0,255 + 1 =0,0,0,0,0,0,1,6. The first 5 are reserved. There should never be...
Sorry to have caused confusion. Thank you all for helping me with this.
Yes that is what I mean. I was simplifying it(maybe it would be better to be verbose from now on).
The rules for the program are this: it must translate for ull to a char array(ints are not permitted). example of it's change: 0,0,0,0,0,0,255,255, add one to it and it becomes 0,0,0,0,0,7,0,0 and...
Then I have to make it to where it goes to the next element in the char array.I just don't know how to start at like 7 in the array and keep adding and make it spill over so that 0,0,0,0,0,0,0,255 +1...
so if I had a char array with 8 elements and it was 0,0,0,0,0,0,0,7 doing +1 would not change that 7 to an 8?
I am not trying to use the address, I am attempting to change the value itself in output.
#include<stdio.h>
int main()
{
unsigned long long counter1 =18446744073709551615ULL;
char output[8]={0,0,0,0,0,0,0,1};
FILE *fp;
fp=fopen("d:\\crypt.h", "w");
...
It is not letting me post regular reply I need it to so I can go advanced and use the code tags that work, if I just type them in it comes out garbled. It is also not letting me edit my post. When I...
I will try to fix it.
Why is it giving me this error, all I am doing is changing output by adding one to whats already in there hoping that it would advance it.
I changed it
#include<stdio.h>
int main()
{
unsigned long long counter1 =18446744073709551615ULL;
char output[8]={0,0,0,0,0,0,0,1};
FILE *fp;
fp=fopen("d:\\crypt.h",...
Thank you.
output +1 is supposed to advance to the next char in output it should be output=output+1
on the line right before it ,output is printed or supposed to be
so after it prints output then...
#include<stdio.h>
int main()
{
unsigned long long counter1 =18446744073709551615;
char output[8]={0,0,0,0,0,0,0,1};
FILE *fp;
fp=fopen("d:\\crypt.h", "w");
...
your right I don't need counter2&1. output+1 is supposed to be incrementing the char array by one.
the only warnings I am getting are:
C:\Users\Ben\Documents\newheathe3.c||In function 'main':|
C:\Users\Ben\Documents\newheathe3.c|4|warning: integer constant is so large that it is unsigned...
I am using mingw with code::blocks.
The code compiles without complaining but it does nothing when I run it except show the console.
#include<stdio.h>
int main()
{
unsigned long long counter1 =18446744073709551615;
char output[8]={0,0,0,0,0,0,0,0};
FILE *fp;
fp=fopen("d:\\crypt.h", "w");
...
Still having the trouble of posting code. It garbles it whether I am using IE or FF
Having trouble writing a program that writes source code.