Click here to Skip to main content
15,921,226 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to use friend function? Pin
IT_student23-Jul-03 4:23
IT_student23-Jul-03 4:23 
GeneralRe: how to use friend function? Pin
Alexander M.,23-Jul-03 4:34
Alexander M.,23-Jul-03 4:34 
QuestionHow do I break up a string? Pin
Tom Wright23-Jul-03 3:36
Tom Wright23-Jul-03 3:36 
AnswerRe: How do I break up a string? Pin
keegan23-Jul-03 3:45
keegan23-Jul-03 3:45 
GeneralRe: How do I break up a string? Pin
Tom Wright23-Jul-03 3:56
Tom Wright23-Jul-03 3:56 
GeneralRe: How do I break up a string? Pin
David Crow23-Jul-03 4:03
David Crow23-Jul-03 4:03 
AnswerRe: How do I break up a string? Pin
Alexander M.,23-Jul-03 4:11
Alexander M.,23-Jul-03 4:11 
AnswerRe: How do I break up a string? Pin
LittleYellowBird23-Jul-03 4:27
LittleYellowBird23-Jul-03 4:27 
Tom Wright wrote:
Being a cobol programmer too, in cobol we can just move it into a structure where the structure is set with all the fields and their fixed lengths. Can I do this in VC also?

I'm not an expert C++ programmer but I wondered if you could use a union and a struct for this? A union allows you to access multiple data formats in a single location. So you would store the data as 1 big string and read it as lots of little ones. I've used unions before in general C programming and they can be really powerfull.

I think you might have to store the data as arrays of characters not strings because on the fixed length. You would declare a structure & union something like this....

struct sData{<br />
char cData[35];<br />
union{<br />
char c1[10];<br />
char c2[20];<br />
char c3[5];<br />
} fields;<br />
};

<br />
struct sData sMyData;


Access the 'full' string like this :-
sMyData.cData

Access the 'field' strings like this :-
sMyData.fields.c1<br />
sMyData.fields.c2<br />
sMyData.fields.c3



It might be worth a look. Good luck,



Ali
GeneralRe: How do I break up a string? Pin
Tom Wright23-Jul-03 5:02
Tom Wright23-Jul-03 5:02 
GeneralRe: How do I break up a string? Pin
AlexO23-Jul-03 6:41
AlexO23-Jul-03 6:41 
GeneralRe: How do I break up a string? Pin
LittleYellowBird24-Jul-03 2:19
LittleYellowBird24-Jul-03 2:19 
Generallistctrl with large number of items Pin
pranavamhari23-Jul-03 3:36
pranavamhari23-Jul-03 3:36 
GeneralRe: listctrl with large number of items Pin
Maximilien23-Jul-03 3:46
Maximilien23-Jul-03 3:46 
GeneralRe: listctrl with large number of items Pin
David Crow23-Jul-03 4:13
David Crow23-Jul-03 4:13 
GeneralRe: listctrl with large number of items Pin
pranavamhari23-Jul-03 15:53
pranavamhari23-Jul-03 15:53 
GeneralRe: listctrl with large number of items Pin
David Crow24-Jul-03 2:23
David Crow24-Jul-03 2:23 
GeneralRe: listctrl with large number of items Pin
pranavamhari23-Jul-03 15:51
pranavamhari23-Jul-03 15:51 
GeneralRe: listctrl with large number of items Pin
Alexander M.,23-Jul-03 4:06
Alexander M.,23-Jul-03 4:06 
GeneralIf you really don't wanna use Virtual or Owner draw... Pin
Abin23-Jul-03 16:28
Abin23-Jul-03 16:28 
QuestionListCtrl background color control? Pin
spaced_out23-Jul-03 3:32
spaced_out23-Jul-03 3:32 
AnswerRe: ListCtrl background color control? Pin
Alexander M.,23-Jul-03 4:12
Alexander M.,23-Jul-03 4:12 
GeneralRe: ListCtrl background color control? Pin
spaced_out23-Jul-03 5:04
spaced_out23-Jul-03 5:04 
GeneralPreventing a space in an edit box Pin
keegan23-Jul-03 3:31
keegan23-Jul-03 3:31 
GeneralRe: Preventing a space in an edit box Pin
David Crow23-Jul-03 3:33
David Crow23-Jul-03 3:33 
GeneralRe: Preventing a space in an edit box Pin
valikac23-Jul-03 5:05
valikac23-Jul-03 5:05 

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.