Solved

Function call

Posted on 2006-11-01
4
248 Views
Last Modified: 2011-09-20
Hi,

I'm trying to convert some C code to VB.Net can anyone explain the following C function call to me.

Thank you.


stream( 1, ck, (unsigned char *)puiData64, (unsigned char *)(&uiIB64) );

0
Comment
Question by:IAJWDDIY
  • 2
4 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 17852982
it calls the function stream with the arguments
1
ck
puiData64 casted to a pointer to an unsigned character
the address of uiIB64 casted to a pointer to an unsigned char

we may be able to tell you more of we saw the definiton of the stream function and the definitions of
ck, puiData64 and uiIB64
0
 

Author Comment

by:IAJWDDIY
ID: 17853346
These are the definitions and the function.

 unsigned  __int64   uiIB64;
   unsigned  __int64  *puiData64 = (unsigned __int64 *)(&data[ offset ]);

void stream(int init, unsigned char *CK, unsigned char *sb, unsigned char *cb) {

0
 
LVL 45

Accepted Solution

by:
Kent Olsen earned 500 total points
ID: 17857539

Hi IAJWDDIY,

>> unsigned  __int64   uiIB64;

__int64 is an extension to C that specifies that the variable will be a 64 bit integer.  It's one of the few integer types that are guaranteed to be a specific size.  The C RFC doesn't place many restrictions on integer sizes leaving the definition(s) to the implementation.  About the only thing that the RFC does define is that "a short shall not be larger than an int, nor shall an int be larger than a long".  (I used one of the early 64-bit system some years ago where a short, int, or long all resulted in a 64-bit variable!)

The statement above simply declares a 64-bit integer named uiIB64.


>>  unsigned  __int64  *puiData64 = (unsigned __int64 *)(&data[ offset ]);

This declares a variable and initializes it at the same time.  It may or may not be legal, depending upon the compiler.

The variable (puiData64) is a pointer to a 64-bit integer.


>> void stream(int init, unsigned char *CK, unsigned char *sb, unsigned char *cb) {

The program is declaring a function called stream().  The function has 4 parameters -- an integer and 3 pointers to characters (character arrays).



Good Luck,
Kent

0
 

Author Comment

by:IAJWDDIY
ID: 17858699
Thank you again Kent.

p.s Your motto made me laugh!
0

Featured Post

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question