-
March 23rd, 2010, 12:04 AM
#1
CList question
Quick question, how do you write the contents of the cell in CList into a file named 'Data'? It's part of an assignment and I am currently stuck on that. Appreciate the help in advance, thanks!
-Rob
-
March 23rd, 2010, 05:24 PM
#2
Re: CList question
self bump, really need help with this.. thanks!
-
March 23rd, 2010, 05:38 PM
#3
Re: CList question
What is CList? Are you sure you need to post in the C# forum?
-
March 23rd, 2010, 05:41 PM
#4
Re: CList question
CList is not a C# class, MFC?
-
March 23rd, 2010, 05:44 PM
#5
Re: CList question
I'm sorry, I should have elaborated.. CList is supposed to be an array...
-
March 23rd, 2010, 05:58 PM
#6
Re: CList question
Why would CList be an array? Wouldn't it be called CArray?
What language are you writing in? C#, C++, other? If C++, are you using MFC?
Where are you getting CList? Is it part of a library? Are you suppose to write it?
-
March 23rd, 2010, 06:13 PM
#7
Re: CList question
I didn't write the code, but I am using C#, CList is an array according to an assignment I have to complete.. Hope that clears up any questions... If you have anymore I'll try and answer to the best of my ability..
The first question in the assignment was "Write the code to create an array named CList consisting of 20 cells. Each cell is capable of storing one character"
The answer that I had gotten for that was char [] clist = new char [20]
-
March 23rd, 2010, 08:04 PM
#8
Re: CList question
I feel like I may be getting close:
while(int variable < clist.length-1) Console.Write clist[int variable];
maybe?
-
March 23rd, 2010, 10:00 PM
#9
Re: CList question
No, that is an endless loop. You want a basic for or foreach loop:
Code:
for( int i = 0; i < clist.Length; ++i )
{
Console.WriteLine( clist[i] );
}
// or...
foreach( char c in clist )
{
Console.WriteLine( c );
}
As 'clist' is an array and not a list, the name is a bit odd...
-
March 24th, 2010, 12:02 AM
#10
Re: CList question
Ah I see, thank you very much.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|