Solved

Char [ ]

Posted on 1998-09-02
1
271 Views
Last Modified: 2010-04-02
I have a char [50] called buf, when I try:
buf = "D:\\Masks\\";
it tells me it can't convert a char[10] to char[50]
0
Comment
Question by:jtm082698
1 Comment
 
LVL 8

Accepted Solution

by:
Answers2000 earned 30 total points
ID: 1171938
1. try

strcpy( buf, "...etc..." ) ;

 to do the copy

you need to #include<strings.h>

2. if you are initializing and never changing the string, you can do

char buf[] = "...etc.." ;

the buf string is then allocated to exactly the right size.
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
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 how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
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.

773 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