|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (4 bit)
Join Date: Jan 2004
Location: Barrie
Posts: 8
|
Could anyone please tell me how to make arrays loops and files on C++ I I have visual c++ and i need to know how to make them ASAP
email: clueleswonder69@hotmail.com THANK YOU THANK YOU TO ANYONE WHO CAN HELP |
|
|
|
|
|
#2 |
|
Registered User
Join Date: Nov 2001
Posts: 1,965
|
as for array loops, I guess you want to ask how to loop through the variables of an array:
Code:
#include <iostream>
using namespace std;
#define SIZE 10
int main(void) {
int array[SIZE]; // size is a const var or a define
for (int i = 0; i < SIZE; i++) {
cin >> array[i];
}
}
Code:
#include <iostream>
using namespace std;
int main(void) {
ofstream file("myfile.txt") // for output
int number = 5;
file << number;
}
HTH ps: what's the wrong with the boards so you want us to email you. edit: fixed < and > Last edited by aym; 01-19-2004 at 08:40 AM. |
|
|
|
|
|
#3 |
|
Member (4 bit)
Join Date: Jan 2004
Location: Barrie
Posts: 8
|
Thanks So much, i have to have this finished by the end of today.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|