Click here to Skip to main content
15,890,512 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: Managed c++ acting funny Pin
Anders Molin15-Mar-04 15:02
professionalAnders Molin15-Mar-04 15:02 
GeneralHiding a serializable property Pin
Hamzeh8-Mar-04 23:14
Hamzeh8-Mar-04 23:14 
GeneralRe: Hiding a serializable property Pin
ian mariano9-Mar-04 9:16
ian mariano9-Mar-04 9:16 
GeneralRe: Hiding a serializable property Pin
Hamzeh9-Mar-04 19:31
Hamzeh9-Mar-04 19:31 
GeneralRe: Hiding a serializable property Pin
ian mariano10-Mar-04 5:37
ian mariano10-Mar-04 5:37 
GeneralRe: Hiding a serializable property Pin
Hamzeh10-Mar-04 21:55
Hamzeh10-Mar-04 21:55 
GeneralReading text file to 2D arrays Pin
kfresh8-Mar-04 8:56
kfresh8-Mar-04 8:56 
GeneralRe: Reading text file to 2D arrays Pin
Antti Keskinen16-Mar-04 23:49
Antti Keskinen16-Mar-04 23:49 
Consider the following aspects:

1. The file itself consists of characters, written sequentically. A line change is represented by a delimeter character, usually '\n'.
2. The above having said, all numbers in your text file are represented by characters.

For the CRT, there are routines that can convert a character string into a numeric variable, such as to an integer or to a float. Now, you should first piece up the reading into smaller parts. For example, instead of reading the entire file, try reading a single row (read until character equals '\n').

After this, parse the line you just read, considering that the line begins with a number, and all numbers are seperated by a white space. So, from start of the line, copy characters into a temporary buffer until you face a white space character (' '). Then run this temporary buffer through a char-to-number conversion routine, and save the converted integer into the array. Jump over the white space, and repeat.

This being a homework assignment, I won't give you a direct code example, but will guide you to the correct routines. For the numeric conversions, see _atoi in the MSDN. For the text file reading, how about copying the entire file into a HUGE buffer first, then parsing through the buffer line-by-line, and ultimately, each line by a number-by-number basis ?

You can run through a character string by using index numbers, for example, if char buffer[2000] then buffer[nIndex] would be a single character in the buffer.

Enjoy Smile | :)

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralRe: Reading text file to 2D arrays Pin
ravjak25-Mar-04 6:26
ravjak25-Mar-04 6:26 
GeneralSharing form controls between two forms Pin
Devaraju .R8-Mar-04 3:23
Devaraju .R8-Mar-04 3:23 
GeneralRe: Sharing form controls between two forms Pin
ian mariano10-Mar-04 5:45
ian mariano10-Mar-04 5:45 
GeneralRe: Sharing form controls between two forms Pin
Anonymous12-Mar-04 14:01
Anonymous12-Mar-04 14:01 
GeneralRe: Sharing form controls between two forms Pin
ian mariano15-Mar-04 12:10
ian mariano15-Mar-04 12:10 
Questionhow do i?? Pin
Anonymous8-Mar-04 3:14
Anonymous8-Mar-04 3:14 
AnswerRe: how do i?? Pin
ian mariano9-Mar-04 9:22
ian mariano9-Mar-04 9:22 
Generallook ahead function in tic-tac-toe Pin
kclei4-Mar-04 21:58
kclei4-Mar-04 21:58 
GeneralRe: look ahead function in tic-tac-toe Pin
Shog95-Mar-04 11:35
sitebuilderShog95-Mar-04 11:35 
GeneralRe: look ahead function in tic-tac-toe Pin
Nick Parker6-Mar-04 8:34
protectorNick Parker6-Mar-04 8:34 
GeneralRe: look ahead function in tic-tac-toe Pin
kclei11-Mar-04 3:53
kclei11-Mar-04 3:53 
GeneralInstantiating unmanaged class from managed code Pin
xcvbxcvbxcv4-Mar-04 4:48
xcvbxcvbxcv4-Mar-04 4:48 
GeneralRe: Instantiating unmanaged class from managed code Pin
ian mariano4-Mar-04 11:04
ian mariano4-Mar-04 11:04 
GeneralRe: Instantiating unmanaged class from managed code Pin
xcvbxcvbxcv10-Mar-04 5:35
xcvbxcvbxcv10-Mar-04 5:35 
GeneralC++Builder5 TListBox to char Pin
kjetilh4-Mar-04 2:22
kjetilh4-Mar-04 2:22 
Generalregsvr32 utility Pin
adarsh_sebiz3-Mar-04 18:55
adarsh_sebiz3-Mar-04 18:55 
GeneralRe: regsvr32 utility Pin
Dudi Avramov4-Mar-04 1:59
Dudi Avramov4-Mar-04 1:59 

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.