Solved

bzero/bcopy : undefined

Posted on 2004-09-05
2
2,903 Views
Last Modified: 2012-05-05
Hello.        
I tried to compile some code (MSVC) with the following fragment.

bzero( k_opad, sizeof k_opad);
bcopy( key, k_ipad, key_len);

Visual studio don't seems to know those two functions. In which header file are they defined??
0
Comment
Question by:zeugje
[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 Comments
 
LVL 23

Accepted Solution

by:
Mysidia earned 50 total points
ID: 11985498
#include <strings.h>

MSVC might not have it

in that case I suggest using the C string library
#include <string.h>
instead
and use these functions:
 memset(memory, 0, size);
 memcpy(destination, src, length);

use memmove instead of memcpy  (if the memory areas are allowed to overlap)

Or if you want to think of this in terms of macros s. like...

#define bzero(memArea, len)  memset((memArea), 0, (len))
#define bcopy(memSrc, memDst, memLen) \
                    memcpy((memDst), (memSrc), (memLen))
0
 

Expert Comment

by:pimpernel
ID: 11986219
Thanks. It works indeed.
(ps.: do you happen to know if this is correct: "#define caddr_t char*" (maybe both bzero and caddr_t are linux command/structures (????))
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

Suggested Solutions

Title # Comments Views Activity
C++ :Change value from  DisableCMD registry 4 71
Beginner to Unreal Engine 4 5 107
How to convert Structure to vector of byte and vice versa 5 31
print bytes of an integer 6 27
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

730 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