header file problem please help

My program won't run it says fatal error stdafx.h: no such file or directory.
What's wrong?

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


#include "stdafx.h"
#include<iostream>
using namespace std;

int *Shifted_array(const int *,int) ;

void main ()
{
    int array[20];
    int *Shifted;
    int size;
    int i;

    cout << "Enter size of array: " << endl;
    cin > size;

    cout << "Enter elements: ";
    for(i=0;i<size;i++)
        cin >> array[i];
    Shifted=Shifted_array(array,size);
    cout << "The elements after shifting the array: " << endl;
    for(i=0;i<size+1;i++)
        cout << *(Shifted+i) << endl;
    system("pause");
}

int *Shifted_array(const int *arr,int size)
{
    int *New_array=new int[size+1];
    int i,m;
    New_array[0] = 0;
    m=1;
    for(i=0;i<size;i++)
    {
        New_array[m] = arr[i];
        m++;
    }
    return New_array;
}
Last edited on
closed account (18hRX9L8)
Please do not post multiple threads of the same question.
Topic archived. No new replies allowed.