Course Solutions Uncategorized (Solved) : C Prgoramming Use Three Include Problem Warning Program Uses Gets Unsafe User Add Note Lik Q31607708 . . . .

(Solved) : C Prgoramming Use Three Include Problem Warning Program Uses Gets Unsafe User Add Note Lik Q31607708 . . . .

 

//C Prgoramming.. Only can use these three (include)

//I have this problem “warning: this program uses gets(), whichis unsafe.”

// User can add note like “Add your Note: Size 11 and blackcolour”

//Also, the prurshed item is not working and showing allpurshased item if there is more than one

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

#define SIZE 3

struct Item

{

  

char name[100];

  

int id;

  

double price;

  

};

struct ItemOrder

{

  

char name[100];

  

int id;

  

double price;

  

char note[500];

  

};

struct ItemOrder*expander(struct ItemOrder ex_arr[],int counter, int id,char *name, double price,char *note)

{

  

struct ItemOrder *new_arr =(struct ItemOrder*)malloc(sizeof(struct ItemOrder)* (counter + 1));

  

new_arr[counter].id = id;

  

strcpy(new_arr[counter].name, name);

  

strcpy(new_arr[counter].note, note);

  

new_arr[counter].price = price;

  

return new_arr;

  

}

int main()

{

  

int choice;

  

struct ItemOrder *itemsOrdered;

  

int i, counter = 0;

  

struct Item item[SIZE];

  

item[0].id = 1;

  

strcpy(item[0].name, “Football Boot”);

  

item[0].price =

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post