Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Function call

Posted on 2006-11-01
4
Medium Priority
?
253 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

Industry Leaders: 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

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 how to create, access, and change arrays in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

604 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