-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArrayAndPointer.cpp
More file actions
47 lines (43 loc) · 965 Bytes
/
ArrayAndPointer.cpp
File metadata and controls
47 lines (43 loc) · 965 Bytes
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
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <ios>
#include <stdexcept>
//#include "grade.h"
#include <iomanip>
#include <map>
#include <sstream>
//#include <boost/filesystem.hpp>
#include <conio.h>
using namespace std;
int main(int argc, char** argv){
//pointer iþlemi
int x = 5;
int* p = &x;
cout << "x = " << x << endl;
*p = 6;
cout << "x = " << x << endl<<endl;
//ay günlerini yazdýrma
const int month_lengths[] = {
31, 28, 31, 30, 31, 30,
31, 31, 30, 31, 30, 31
};
for(int i=0; i<12; i++){
cout<<month_lengths[i]<<endl;
}
//ekrana char dizisi yazdýrma
cout<<endl;
const char hello[] = { 'H', 'e', 'l', 'l', 'o', '\0' };
for(int i=0; i<6; i++){
cout<<hello[i];
}
//main fonksiyonu içinde ki parametreler ile iþlem yapma
if (argc > 1) {
int i;
for (i = 1; i < argc-1; ++i)
cout << argv[i] << " ";
cout << argv[i] << endl;
}
return 0;
}