?
Solved

Function call

Posted on 2006-11-01
4
Medium Priority
?
251 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 46

Accepted Solution

by:
Kent Olsen earned 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
Suggested Courses

752 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