Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
i have to define byte array in C/C++
I searched net and found various examples,so confused which one is correct:-
Out of these which one is correct?
unsigned char bytes[]=0x43,0x4d,0x30,0x30,0x0f,0x0D};
const char data3[]={0x43,0x4d,0x30,0x30,0xf0,0x0D};
char data[4]="CM00";
Posted 14-Sep-12 18:59pm
Sergey Alexandrovich Kryukov at 15-Sep-12 1:48am
If you have a compiler, you can easily figure this out. If this is some kind stupid interview/test question, this is the abuse(, too :-)). --SA
Mohibur Rashid at 15-Sep-12 3:22am
First of all your code is incorrect. secondly there is few issue you will have learn at the beginning of c programming. I believe you are still beginner. you better study more

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
0 Sergey Alexandrovich Kryukov 860
1 OriginalGriff 427
2 Abhinav S 303
3 thatraja 225
4 CPallini 208
0 Sergey Alexandrovich Kryukov 8,122
1 OriginalGriff 4,520
2 Peter Leow 3,744
3 Maciej Los 3,515
4 Er. Puneet Goel 3,107

Advertise | Privacy | Mobile
Web03 | 2.8.140415.2 | Last Updated 15 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid