Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 293
  • Last Modified:

Char [ ]

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
jtm082698
Asked:
jtm082698
1 Solution
 
Answers2000Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

Tackle projects and never again get stuck behind a technical roadblock.
Join Now