im writing a simple program
int main()
{
std::cout << "hello";
}
Type: Posts; User: rs07
im writing a simple program
int main()
{
std::cout << "hello";
}
so i got a character input from the user, converted it into an integer, and have that integer stored in m.
now im trying to convert that integer into binary...heres the code im using to do that:
...
how can I get a user to input a character and convert that character to its binary equivalent?
word i got it working
edit: thanks valaris, i did it a different way but thanks for your time.
ok I have an array with 8 characters composed of either 0s or 1s. for example i have an array that if you print all its contents, you will get 01110100. however the characters are assigned randomly,...
haha oh jeez, that guy is more than likely in my class. small world. i just assumed you meant me, but thanks for directing me.
that was me, but i was asking how to find the hamming distance and havent been able to figure it out thus far. so im taking a step back and trying to figure out how to just print the 0 and 1s first...
ive dynamically allocated an array of two bytes using
char *ptr1 = (char *)malloc (2*sizeof(char));
now how can I print the number of ones and zeros in the memory allocated?
the example section of that page says:
The Hamming distance between:
10 *1* 1 *1* 01 and 10 *0* 1 *0* 01 is 2.
im trying to find the Hamming Distance between the two bytes in the memory...
ive dynamically allocated an array of two bytes using:
char *ptr = (char *)malloc (2*sizeof(char));
how can I find the Hamming distance between the two bytes?
is:
struct student {
char id[10];
char name[26];
int gradePoints;
};
the same as:
is there any command in C that scans elements in an array to find a certain string? i have a student records program im working on that has last names and marks of an imaginary class. i want to have...
i got it guys, i found out how to use the fopen fscan stuff and its cool now. thanks anyway.
yeah I do.
i've created the structure lol. i dont know how to read or store though :|.
say I have a text file that follows the format:
student last name student number student grade
for example:
smith 17892 82
peterson 12891 79
mcdonald 97022 93
how do I write a makefile for program that has test.c file, and a test.h header file?
thanks.
sorry guys. basically it looks like it is swapping something, but not the right ones.
for example the original arrays were [5.7.2.8.1] and [3,6,9,0,2] and I input element 3 in table_A to be...
i have two size 5 arrays. the user types in two numbers, the first number represents the index of the first array that will be swapped and the second number represents the index of the second array...
figured it out, i was putting , instead of ;