GIDForums  

Go Back   GIDForums > Computer Programming Forums > MS Visual C++ / MFC Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 07-Oct-2004, 13:53
nbalderaz nbalderaz is offline
New Member
 
Join Date: Oct 2004
Posts: 2
nbalderaz is on a distinguished road

storing an array


Can someone help me with my storing array problem. I have an array and i need to have MFC create a text file and save my array in that textfile but it must be saved in rows and columns like a matrix. I am doing my code in C++ and of course I am using MFC, also can someone tell me how to read in a matrix from an external file saved on my computer this way I can just read in the file and set it as my matrix_a. Here is my code for the matrix:

CPP / C++ / C Code:
int matrix_a[10][10]={1,2,3,4,5,6,7,8,9,10,
		11,12,13,14,15,16,17,18,19,20,
		21,22,23,24,25,26,27,28,29,30,
		31,32,33,34,35,36,37,38,39,40,
		41,42,43,44,45,46,47,48,49,50,
		51,52,53,54,55,56,57,58,59,60,
		61,62,63,64,65,66,67,68,69,70,
		71,72,73,74,75,76,77,78,79,80,
		81,82,83,84,85,86,87,88,89,90,
		91,92,93,94,95,96,97,98,99,100};
//PRINTS OUT MATRIX A
for (int i=0;i<rows_columns;i++)
	{
	for(int j=0;j<rows_columns;j++)
		{
		res.AppendFormat("%i ",matrix_a[i][j],"\n");
		
		}
		outputText.SetString(res);
		UpdateData(0);
		}
Last edited by JdS : 08-Oct-2004 at 05:00. Reason: Please insert your example C/C++ codes between [c] and [/c] tags
 
 

Recent GIDBlogPlanned Network Maintenance on 2013-05-29 by gidnetwork

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
looking for a way to identify a repetitive sequence of digits in an array or string sho C++ Forum 8 14-Jun-2004 23:59
Speed up C++ code about 3d array! Truong Son C++ Forum 0 16-Mar-2004 21:52
c: array comparison jack C Programming Language 7 26-Jan-2004 11:21
Extra null element in an array samtediou MySQL / PHP Forum 2 11-Dec-2003 11:52

Network Sites: GIDNetwork · GIDApp · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 04:10.


vBulletin, Copyright © 2000 - 2013, Jelsoft Enterprises Ltd.