Click here to Skip to main content
16,005,066 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Unicode and cstring Pin
PJ Arends30-Jul-04 23:15
professionalPJ Arends30-Jul-04 23:15 
Generalchar str[256] AND char *str = new char(256) Pin
Igor Mihailov30-Jul-04 10:44
Igor Mihailov30-Jul-04 10:44 
GeneralRe: char str[256] AND char *str = new char(256) Pin
Kosk30-Jul-04 12:01
Kosk30-Jul-04 12:01 
GeneralRe: char str[256] AND char *str = new char(256) Pin
Gary R. Wheeler30-Jul-04 12:24
Gary R. Wheeler30-Jul-04 12:24 
GeneralRe: char str[256] AND char *str = new char(256) Pin
Archer28230-Jul-04 13:03
Archer28230-Jul-04 13:03 
GeneralSetting Wallpaper Pin
Archer28230-Jul-04 10:40
Archer28230-Jul-04 10:40 
GeneralSPIF_SENDCHANGE ? Pin
bikram singh31-Jul-04 16:14
bikram singh31-Jul-04 16:14 
GeneralInitialising a items in a structure Pin
Grahamfff30-Jul-04 10:35
Grahamfff30-Jul-04 10:35 
I wist to initialise some items in a structure, but the only way I can see to do it is as follows:-

// General part of the Structure (used many times)<br />
typedef struct <br />
{<br />
	char	fieldDesc 	[100];<br />
	char	detailsDesc     [20];<br />
	char	unitsStr 	[10];<br />
}GENERAL_DATA;<br />
<br />
// The main structure<br />
typedef struct <br />
{<br />
	unsigned short	data; // Dyanamic data<br />
	GENERAL_DATA	details;  // Static data<br />
}ITEM_DATA;<br />
<br />
ITEM_DATA thisItem;<br />
<br />
strcpy(thisItem.details.fieldDesc,"The field description");<br />
strcpy(thisItem.details.detailsDesc,"This is the details..");<br />
etc


Are they any way I can set the char data up in ITEM_DATA, or could I set the constant data up in a new structure:-

// General Structure<br />
typedef struct <br />
{<br />
	unsigned short	data; <br />
	char	fieldDesc 	[100] = "This is a description";<br />
	char	detailsDesc     [20] = "The details....";<br />
	char	unitsStr 	[10] = "$";<br />
}ITEM_DATA_01;

etc
The above does not work, but thats what I am after!

I know what data should go into the char fields in advance, but the only way I can see to load this constant data in is via a statement like
strcpy(thisItem.details.fieldDesc,"The field description");

Are they any other ways to load this constant data?

Graham.

grahamfff
GeneralRe: Initialising a items in a structure Pin
Kosk30-Jul-04 11:54
Kosk30-Jul-04 11:54 
GeneralRe: Initialising a items in a structure Pin
Grahamfff30-Jul-04 21:07
Grahamfff30-Jul-04 21:07 
GeneralRe: Initialising a items in a structure Pin
Gary R. Wheeler30-Jul-04 12:33
Gary R. Wheeler30-Jul-04 12:33 
GeneralRe: Initialising a items in a structure Pin
Grahamfff30-Jul-04 21:32
Grahamfff30-Jul-04 21:32 
GeneralRe: Initialising a items in a structure Pin
Gary R. Wheeler31-Jul-04 1:55
Gary R. Wheeler31-Jul-04 1:55 
GeneralRe: Initialising a items in a structure Pin
Grahamfff2-Aug-04 10:50
Grahamfff2-Aug-04 10:50 
GeneralRe: Initialising a items in a structure Pin
Sheff30-Jul-04 22:01
Sheff30-Jul-04 22:01 
GeneralDisable maxmize minimize window Pin
magee8130-Jul-04 10:20
sussmagee8130-Jul-04 10:20 
GeneralRe: Disable maxmize minimize window Pin
valikac30-Jul-04 14:11
valikac30-Jul-04 14:11 
GeneralChange IP address Notification Pin
Renjith Ramachandran30-Jul-04 9:46
Renjith Ramachandran30-Jul-04 9:46 
GeneralNotifyAddrChange() Pin
bikram singh31-Jul-04 16:41
bikram singh31-Jul-04 16:41 
QuestionHow to set default web-site from C++? Pin
includeh1030-Jul-04 9:06
includeh1030-Jul-04 9:06 
AnswerRe: How to set default web-site from C++? Pin
Renjith Ramachandran30-Jul-04 9:47
Renjith Ramachandran30-Jul-04 9:47 
GeneralRe: How to set default web-site from C++? Pin
includeh1030-Jul-04 9:55
includeh1030-Jul-04 9:55 
GeneralREFERENCE TO ARRAY OF 10 INTEGERS Pin
avenger_sb2530-Jul-04 7:57
avenger_sb2530-Jul-04 7:57 
GeneralRe: REFERENCE TO ARRAY OF 10 INTEGERS Pin
Jaime Stuardo30-Jul-04 8:37
Jaime Stuardo30-Jul-04 8:37 
GeneralRe: REFERENCE TO ARRAY OF 10 INTEGERS Pin
avenger_sb2530-Jul-04 8:48
avenger_sb2530-Jul-04 8:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.