3
Contributors
6
Replies
8
Views
7 Years
Discussion Span
Last Post by Akulki
0

why bits? The smallest addressable memory location is a byte -- usuually 8 bits. And how to get the amount of RAM is operating system dependent.

Edited by Ancient Dragon: n/a

0

It looks that u have not understood the question. We can know the memory size in bits using a simple C program, but unfortunately i don't know the algorithm for it :(

0

>It looks that u have not understood the question.
I don't understand either. I'd wager that the problem isn't with us, it's with your ability to ask a coherent question.

0

Memory is in bytes, not bits. Don't confuse the two.

Are you trying to ask how to find the size of a variable? For example

char buf[255];

printf("size of buf is %d\n", sizeof(buf));

The sizeof operator (its not a function) can not be used to find the memory size of pointers

char * buf = malloc(255);
// The next line will give you the wrong size
// unless you want the size of a pointer and not
// what it points to.
printf("size of buf is %d\n", sizeof(buf));

Edited by Ancient Dragon: n/a

0

Can I do like this?
main()
{
printf("%d",INT_MAX);
}

0

please give me a C syntax for character testing operations......

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.