My program does not stop on condition

前端 未结 4 1081
别跟我提以往
别跟我提以往 2021-01-26 01:03

So- my program does not stop on condition (str2[o] != \'+\') So if anyone knows why and how to fix it it will help me ( :.

this is My code -

#include <         


        
4条回答
  •  有刺的猬
    2021-01-26 01:23

    while(str2[o] != '+') 
        {
            str2[o] = str3[w]; 
            o++;
            w++;
        }
    

    Assume o == x. You're assigning value to str2[x]. In while, you are seeing if str2[x+1] == '+', but str2[x+1] is empty.

提交回复
热议问题