My program does not stop on condition

前端 未结 4 1163
别跟我提以往
别跟我提以往 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:22

    At the moment + will be copied to str2, o index will point to the next char, which most probably won't be +, so you condition will never be true. This could be possible solution :

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

提交回复
热议问题