Question: Everytime i code for this project i get the segmentation fault ( code dumped ) PLEASE HELP The purpose of this project is to write

Everytime i code for this project i get the segmentation fault (code dumped ) PLEASE HELP
The purpose of this project is to write C++ programs using arrays to initialize them, modify them and write them to a file. We discussed in class how to create a ppm image using a three-dimensional array of type uint8_t. Our image displayed the characters UNT in green color with a white background. The image size was 640480 pixels. In this project you will create a similar image of size 640320 pixels where 640 is the width and 320 is the height in pixels. In the top half of the image, you will display CSCE and in the bottom half of the image you will display UNT.
Center each text in their respective half horizontally. The vertical spacing between characters should be 10 pixels and the vertical spacing from characters to the top and bottom edges of the image as well as to the horizontal line in the center of the image should be 10 pixels. The horizontal spacing between the left and right edges and the fop line of characters should be 10 pixels. The horizontal spacing between the left and right edges and the bottom line of characters should be at least 10 pixels. The horizontal spacing between characters should be 10 pixels.
All the above specifications mean that the height of each character would be 140 pixels. The top line of characters would be vertically centered on row 70 and the bottom line of characters would be vertically centered on row 230. You can choose the width of each character while making sure that the horizontal spacing between characters is 10 pixels.
Color each character randomly. Use the same random color for every pixel in a character.
Use a three-dimensional array for handling the top half of the image. Use a three-dimensional vector for handling the bottom half of the image.
The following function prototypes should be used and the corresponding functions be defined and called from main.
//initialize top half of the image with a white background
void initializeTopHalf(uint8_t arr[][maxr][3], const int maxc, const int maxr);
//initialize bottom half of the image with a white background
vector8> initializeBottomHalf(const int maxc, const int maxr):
 Everytime i code for this project i get the segmentation fault

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!