I have tried writing a code to print Pascals triangle of n size. In it I have used pointers and bidimensional arrays which I am not very skilled with.When I run it I get two error messages, but never at the same run. It complains about access violations (I put the error message next to the code that it was aimed at) which probably depends on that I've used either arrays or pointers in the wrong way. The error messages about lost PBD files, or files that can not be opened, I don't actually know what mean.
I'd be greatful for any help at all. You could just point me in the right direction. (I don't know if the code does what I want it to but I can't get it to run si I wouldn't know if it doesn't.

Code:
#include <iostream>
#include <new>
using namespace std;

int setUp(){
int input;

	cout << "This program will let you create a Pascals triangle of prefered size." << endl;
    cout << "Enter the amount of rows you wish the triangle to have: ";
    cin >> input;
    cout << endl << endl;

return input;
}

int triangle(int wid){
int i, j, k;
int **p, row = wid, col = wid;

	p = new int* [row]; //create rows of triangle
	for (int row = 0; row < wid; row++)
		p[row] = new int[col]; //create columns of triangle

	for (i = 0; i < wid; i++)
		p[0][i] = 1;

	for (i = 0; i < wid; i++)
		p[i][0] = 1; //fix
		cout << p[i][0] << endl; //fix
		/*
		Error message: Unhandled exception at 0x00da171b in pascalsT.exe: 0xC0000005: Access violation reading location 0xfdfdfdfd.
		It also complains about not being able to find or open a bunch of PBD files half the time as well. Have I saved the file in the wrong way somehow?
		*/

		/* 
		This could come in handy:
		https://msdn.microsoft.com/en-us/library/6decc55h.aspx on fixing an access violation
		and learn how to ****ing use and print ****ing arrays man. Both one and multidimensional
		http://www.cplusplus.com/doc/tutorial/pointers/ (also has a chapter on arrays)
		*/
	
	for (i = 1; i < wid; i++){
		for (j = 1, k = i; i < wid; i++){
			p[j][k] = p[j][k-1] + p[j][k-1];
			cout << p[j][k];
		}
			cout << endl;
	}

return 0;
}

int main(int){
int width = setUp();
	triangle(width);

return 0;
}