you have only allocated memory for one int. that means that i[1] and greater will cause access to random memory area. This will cause unintended behavior later.
123456*123456 cannot be represented by int. It is too big. you can use long long instead.
int x can hold values from -2,147,483,648 to 2,147,483,647 unsignedint x can hold values from 0 to 4,294,967,295 longlong x can hold values from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
123456*123456 = 15,241,383,936
Think about it.
your firstarray = newint is equivalent to firstarray = newint[1] and is almost equivalent to int firstarray[1]. You shold write firstarray = newint[ARRAY_SIZE] where ARRAY_SIZE is desired size of array. If you don't know your array size, you might use vector type
You can use std::numeric_limits to see the smallest and biggest value that the different types can hold. The exact values can differ between compilers and platforms.
#include <iostream>
#include <limits>
int main()
{
std::cout << "unsigned char can hold values between "
<< (int) std::numeric_limits<unsignedchar>::min() << " and "
<< (int) std::numeric_limits<unsignedchar>::max() << ".\n";
std::cout << "signed char can hold values between "
<< (int) std::numeric_limits<signedchar>::min() << " and "
<< (int) std::numeric_limits<signedchar>::max() << ".\n";
std::cout << "unsigned short can hold values between "
<< std::numeric_limits<unsignedshort>::min() << " and "
<< std::numeric_limits<unsignedshort>::max() << ".\n";
std::cout << "signed short can hold values between "
<< std::numeric_limits<signedshort>::min() << " and "
<< std::numeric_limits<signedshort>::max() << ".\n";
std::cout << "unsigned int can hold values between "
<< std::numeric_limits<unsignedint>::min() << " and "
<< std::numeric_limits<unsignedint>::max() << ".\n";
std::cout << "signed int can hold values between "
<< std::numeric_limits<signedint>::min() << " and "
<< std::numeric_limits<signedint>::max() << ".\n";
std::cout << "unsigned long can hold values between "
<< std::numeric_limits<unsignedlong>::min() << " and "
<< std::numeric_limits<unsignedlong>::max() << ".\n";
std::cout << "signed long can hold values between "
<< std::numeric_limits<signedlong>::min() << " and "
<< std::numeric_limits<signedlong>::max() << ".\n";
std::cout << "unsigned long long can hold values between "
<< std::numeric_limits<unsignedlonglong>::min() << " and "
<< std::numeric_limits<unsignedlonglong>::max() << ".\n";
std::cout << "signed long long can hold values between "
<< std::numeric_limits<signedlonglong>::min() << " and "
<< std::numeric_limits<signedlonglong>::max() << ".\n";
}