$ od -x file3.txt
od (Unix) - Wikipedia, the free encyclopedia
Type: Posts; User: lowestOne
$ od -x file3.txt
od (Unix) - Wikipedia, the free encyclopedia
Here is a way that is not recursive:
#include <stdio.h>
int main (int argc, char **argv)
{
unsigned int previous01 = 0;
unsigned int previous02 = 1;
unsigned int current =...
Hi all. I am a C beginner here. I've been using libpng to open png files.
I hope to eventually have one file that has more than one png in it (compressed or not), call it the main file.
Is it...
That makes myStrlen() a little cooler, though I am a little afraid to post code now :)
unsigned int myStrlen(const char* str)
{
return *str? 1 + myStrlen(++str): 0;
}
It does a little. Maybe it is useful, like the index of the array where they are not equal or something.
Sorry, if the < operator was overloaded to properly deal with a c-string.
...
I did mistake LaserLight's quick return as the entire contents of the strcmp function, and also that it was about the char array.
If x and y are char arrays, then
return (x > y) - (x < y); is a...
I made no claims that my way was better than the official strcmp...
Disposition aside, I am very much interested. Thanks for the help. It's a shame that my actual interest, the actual implementation of strcmp, was set aside for what could go wrong with the code...
Somehow you all missed the point of this thread. I guess that's what could be expected from a site who's only purpose is to sell a book
The examples in post 6 have the computer performing the comparison twice. Also opens up the question of what the < operator is doing.
I was able to find this LINK, which does show the source for...
Here is my deal, I've taken intermediate C++ and JAVA and now I'm taking beginner C. In class we're learning about things like "what is an array" and the scope of variables. Some things are...
That's what I just did. Thinking about it though, I guess it could be a bitwise subtraction. I would highly doubt it's a nested if statement. The only tough part is figuring out the four zeros to...
The sign of the char makes no difference, a signed int is returned. Furthermore, of course it's in a loop, that's how I get to i in the first place.
int myStrcmp(const char* str1, const char*...
Here is the explanation for strcmp(), I've highlighted my focus:
Explanation: Tests the strings for equality. Returns a negative number if string1 is less than string2, returns zero if the two...