Too bad the compiler did not produce a better diagnostic.
Type: Posts; User: kona49er
Too bad the compiler did not produce a better diagnostic.
It seems like you're not posting all of your code. I would not expect these
errors from this code frag.
Try:
c ^= (1ull << n);
first mistake, sizeof(char) is 1
You can convince the compiler you know what you're doing by using a cast
unsigned short* data2 = (unsigned short *)data+3;
your mileage may vary but, if your using an unix environment try the following cli command:
$ man abs
ABS(3) NEWLIB
NAME
2.4 `abs'--integer absolute...
Just curious... That's way to many digits for human consumption.
Have you tried using the %e format?
You're missing the { after main. (you need a better compiler :-)
Look at Endianness - Wikipedia, the free encyclopedia. Come back if you still don't get it.
I would not be swapping the bytes. This assumes you know something about
the system architecture. It would not work if you wrote the data on a system
with one Endian and read it back on a system...
It can return to menu! Use the return statement.
(lots of room for other improvements in the code)
Looks like you're bumping into an endian issue.
Look at Endianness - Wikipedia, the free encyclopedia
In the US: it's alive and kicking...
It's not clear what has you so depressed but a quick look at monster.com
reveals this.
Software Engineering Intern Job in Glendale , California US
and...
It you want to use the data in the array after this function returns then you need to define
the array with a more global scope. (see Scope rules in you C book)
e.g.
char figuras[MAX_SIZE];...
Here is something that should be portable:
unsigned long int m, n;
...
m = (n & 0xff000000) >> 24;
Are you sure it not your mutex lock that's causing you problem. If a thread locks a
mutex and then sleeps holding the lock that will block the other threads waiting
for the lock to free.
To be precise it's 22 digits, but it an improvement on the initial 9 digits.
I don't know about millions of digits but if you want a quick & easy way to get much
larger numbers switch to:
unsigned long long int n;
...
sscanf(argv[1],...
Yes, very good suggestions. Thanks.
Sure but ... I'm still wondering how the guy would know how much memory to malloc.
He does not know how many words he will be reading.
With a single pointer, how would he know how much memory to malloc? I seems like
he wants this array to grow dynamically (no bounds on the first dimension).
Hmmm. Are you sure you want to make the first dimension dynamic? You will need
some place to store the pointers for the dynamically allocated memory. If you need
this to be all dynamic, maybe a...
It's hard to know were to start. Other that what's been noted thus far, one glaring
mistake is that none of the code after the return statament will get executed.
The following code runs fine on cygwin compiled with gcc.
#include <stdio.h>
int main()
{
char * rb = "hij";
Yes, my bad. It does work with gcc but that's not a guarantee.
[QUOTE=vart;992964]in this case you should declare it as const - since you do not allocate the memory and just have a pointer to the constant string that cannot be modified.
const char...