السلام عليكم ورحمة الله وبركاتة
اسعد الله ايامكم انا عندي سؤال في سي بلس بلس وهو برنامج جاهزة بس يوجد علية اضافات والاضافات كالاتي:
2- Write a program that:
• dynamically allocate an array of 10 characters.
• Fill the array with the letters A , B ,… and so on.
• Finally print the contents of the array and delete the array.
For section 706 -- Use the letters you did take the casting !!
وهذه محاولتي فهل ممكن تصحيح لكودي
#include <iostream>
using namespace std;
//////////////////////////////////////////////////
void bill(int x, int *y)
{
cout << "The arguments passed to bill are x ="<< x << " *y = " << *y<<endl;
x = x + 5;
*y = *y + 5;
cout << "The arguments after being modified are x ="<< x << " *y = " << *y<<endl;
}
void main( )
{
int a = 5;
int b = 10;
char *list;
char size;
char ob='a';
delete list;
cout << "The values before bill called are a ="<<a<<", b ="<< b<<endl;
bill (a,&b);
cout << "The values after bill are a ="<<a<<", b ="<< b<<endl;
cout<<(char)(ob+1)<<endl;
for (int row = 0; row < 4; row++)
list[row] = new int[10];
delete []list;