03-03-2002
I wasn't sure is this was HP-UX specific, there is a weirdicious feature in GCC that will make the aforementioned program work with two changes (at least under Linux)
Use data type
long long l; /* Not typo! will compile */
and printf("%Ld", l); /* Notice capital L */
If GCC is used on various Os'es, it should work.
(I just checked on Solaris, it prints 1 :-(
Atle
10 More Discussions You Might Find Interesting
1. Programming
What is the difference between int** func() and int*& func(). Can you please explain it with suitable example.
Thanks,
Devesh. (1 Reply)
Discussion started by: devesh
1 Replies
2. Programming
hi,
Please help me with the following code to get the difference in values.
struct a{
int b1;
int c1;
char d1;
}
main()
{
unsigned int b=10;
unsigned int c;
c = b - (unsigned int )sizeof(a);
printf("%d",c);
}
Here c returns some junk value. How can i get the... (2 Replies)
Discussion started by: naan
2 Replies
3. UNIX for Dummies Questions & Answers
hello everybody!
I want to create a file with permissions for read, write, and execute to everybody using C, so I write this code:
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int main(){
int fileDescriptor;
fileDescriptor =... (2 Replies)
Discussion started by: csnmgeek
2 Replies
4. Red Hat
Hello everey one,
here i am attempting to compile a c++ project .it's throughing the following errors.
my machine details are as follows:
Linux chmclozr0119 2.6.18-53.el5 #1 SMP Wed Oct 10 16:34:19 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux
errors:
=====
Generating... (0 Replies)
Discussion started by: mannam srinivas
0 Replies
5. Programming
Hi,
from the manual
listen(2): listen for connections on socket - Linux man page
It has a parameter called backlog and it limits the maximum length of queue of pending list.
If I set backlog to 128, is it means no more than 128 packets can be handled by server?
If I have three... (3 Replies)
Discussion started by: sehang
3 Replies
6. Programming
My question is simple: When should I use a long, int, char, unsigned/signed variables??
When I declare a variable "unsigned;" what did I do it???
Why would I delcare an integer "long" or "short" ( unsigned or signed)??
Any examples of when things like "unsigned", "long", "short" etc...... (6 Replies)
Discussion started by: cpp_beginner
6 Replies
7. Programming
/******************************************************************************/
/* Printing an unsigned character in bits */
#include <stdio.h>
void display_bits ( unsigned char );
int main()
{
unsigned char x; /*... (15 Replies)
Discussion started by: robin_simple
15 Replies
8. Programming
when a date type is considered signed and unsigned is that simple referring to - for signed and positive numbers for unsigned? Further if that is the case would mutiplying and dividing ect where 2 signed numbers, like (-2)*(-2) = 4 result in a unsigned. (3 Replies)
Discussion started by: Fingerz
3 Replies
9. Programming
Hi,
I am unable to assign value zero to my variable which is defined as unsigned char.
typedef struct ABCD
{
unsigned char abc;
unsigned char def;
unsigned char ghi;
} ABCD;
typedef ABCD *PABCD;
In my Por*C code, i assign the values using memcpy like below
... (3 Replies)
Discussion started by: gthangav
3 Replies
10. OS X (Apple)
Hi guys...
Macbook Pro, 13", circa August 2012, OSX 10.7.5, default bash terminal.
I require the capability to convert +32767 to -32768 into signed hex words...
The example piece code below works perfectly except...
#/bin/bash
# sign.sh
# Unsign to sign...
while true
do
# I have used... (2 Replies)
Discussion started by: wisecracker
2 Replies
LEARN ABOUT DEBIAN
dcstats
DCSTATS(1) DICOM PS3 - DICOM image statistics DCSTATS(1)
NAME
dcstats - ACR/NEMA DICOM PS3 ... DICOM PS3 - DICOM image statistics
SYNOPSIS
dcstats [ -v|verbose ] [ -filename ]
DESCRIPTION
dcstats reads the named dicom or acr-nema input file and describes the statistics of the image pixel data. The primary intent is to deter-
mine if the pixel representation is unsigned or signed (regardless of what other attributes may specify).
The description and verbose output go to standard error.
The basic input switches are described in dcintro(1). Options specific to this program are:
-v|verbose
Display byte offset from file start and message start, in hexadecimal, and dump contents while reading and once read.
-filename
Show the name of the file supplied in the arguments; a hyphen will be reported if no filename was supplied.
-filename
Show the name of the file supplied in the arguments; a hyphen will be reported if no filename was supplied.
ENVIRONMENT
EXAMPLES
% dcstats expmeta.dc3
Signed minimum value = 0x0 (0 dec)
Signed maximum value = 0x6e9 (1769 dec)
Unsigned minimum value = 0x0 (0 dec)
Unsigned maximum value = 0x6e9 (1769 dec)
Signed range = 0x6e9 (1769 dec)
Unsigned range = 0x6e9 (1769 dec)
Signed mean = 0x158 (344 dec) (19.446%)
Unsigned mean = 0x158 (344 dec) (19.446%)
Bits Stored = 16
Significant unsigned bits = 11
% dcstats impnone.dc3
Signed minimum value = 0xfa24 (64036 dec)
Signed maximum value = 0x638 (1592 dec)
Unsigned minimum value = 0x0 (0 dec)
Unsigned maximum value = 0xffff (65535 dec)
Signed range = 0xc14 (3092 dec)
Unsigned range = 0xffff (65535 dec)
Signed mean = 0xfec2 (65218 dec) (38.2277%)
Unsigned mean = 0x1cdd (7389 dec) (11.2749%)
Bits Stored = 16
Significant positive bits = 11
Significant negative bits = 11
Offset to make unsigned in hex is = 0x5dc
Offset to make unsigned in dec is = 1500
FILES
SEE ALSO
dchist(1), dcintro(1)
AUTHOR
Copyright (C) 1993-2010. David A. Clunie DBA PixelMed Publishing. All rights reserved.
BUGS
DICOM PS3 6 March 2007 DCSTATS(1)