![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Is the script correct ??? | jaganadh | Shell Programming and Scripting | 0 | 12-13-2007 04:50 AM |
| Tar-ing the correct directories | new2ss | UNIX for Dummies Questions & Answers | 1 | 11-08-2007 10:15 PM |
| Correct the error plz | Mandab | Shell Programming and Scripting | 2 | 05-11-2007 02:15 PM |
| plz correct this | wannalearn | Shell Programming and Scripting | 8 | 04-26-2007 08:56 AM |
| Unsigned int | nimnod | High Level Programming | 2 | 03-03-2002 02:44 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
to get the correct value with unsigned int
hi, Please help me with the following code to get the difference in values. Code:
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 difference between b and sizeof (a) in a positive value without using abs. Thanks Last edited by blowtorch; 04-11-2007 at 06:19 AM.. Reason: add code tags |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|