0

I am using CodeBlocks IDE with Digital Mars compiler, although my program is compiling and there are no errors, when I try to build my program, i get this error and the program isn't running.

OPTLINK (R) for Win32  Release 8.00.5
Copyright (C) Digital Mars 1989-2009  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
OPTLINK : Error 3: Cannot Create File Programs\arrays.exe
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings

My program is :-

#include<iostream.h>
#include<conio.h>
const int MAX=5;
class array{
    private:
    int arr[MAX];
    public:
    void insert(int,int);
    void display();
};
void array :: insert(int pos, int num)
{
    int i=0;
    for(i=pos-1;i<MAX;i++)
      arr[i+1]=arr[i];
    arr[i]=num;
}
void array :: display()
{
    int i;
    cout<<" ";
    for(i=0;i<MAX;i++)
      cout<<arr[i]<<" ";
}
void main()
{
    array a;
    cout<<"Hello World";
    a.insert(1,3);
    a.insert(2,10);
    a.insert(3,15);
    a.insert(4,25);
    a.insert(5,50);

    a.display();
    getch();
}

Please help.

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by rubberman
0

So, what does the linker documentation say that an Error 3 represents? If there were no compilation time errors, then this is probably a linker error, as your title to the post suggests. You could try installing cygwin, and using their gnu compiler to build this. Gnu compiler tools tend to be more informative as to the errors you encounter.

Edited by rubberman: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.