Test case 4 and 6 is wrong why?

#include
#include
#include
using namespace std;
int main(){
string pre,post;
cin>>pre>>post;
long long int m=pre.length();
long long int n=post.length();
bool dp[m+1][n+1];
for(long long int i=0;i<=m;i++){
dp[i][0]=false;
}
for(long long int i=0;i<=n;i++){
dp[0][i]=false;
}
dp[0][0]=true;
for(long long int i=1;i<=m;i++){
for(long long int j=1;j<=n;j++){
if((pre[i-1]==post[j-1])||(post[j-1]==’?’)){

        dp[i][j]=dp[i-1][j-1];
    }
   else if(post[j-1]=='*'){
        dp[i][j]=(dp[i-1][j])||(dp[i][j-1]);
    }
    else{
        dp[i][j]=false;
    }
}

}

if(dp[m][n]){
cout<<1;
}
else{
cout<<0;
}

}

@dineshjani YOu are missing this case when the string can be empty.
Add these lines and your code will work.
// Only ‘’ can match with empty string
for (int j = 1; j <= n; j++)
if (post[j - 1] == '
’)
dp[0][j] = dp[0][j - 1];