• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 256
  • Last Modified:

Function call


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) );

  • 2
1 Solution
it calls the function stream with the arguments
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
IAJWDDIYAuthor Commented:
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) {

Kent OlsenData Warehouse Architect / DBACommented:


>> 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,

IAJWDDIYAuthor Commented:
Thank you again Kent.

p.s Your motto made me laugh!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now