?
Solved

bzero/bcopy : undefined

Posted on 2004-09-05
2
Medium Priority
?
3,070 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 200 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
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.
Suggested Courses

800 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