我是 C 新手,我想了解如何仅使用 strchr() 从字符串中跟踪多个单词。不能使用 strtok、scanf 或类似函数。
我有字符串:
char myImput[51]="my flight to New Orleans, is at 12:30"
字符串格式为:“我的航班城市名,位于 hh:mm” 我想提取城市名(可以有空格)hh 和 mm
有没有办法将城市名称添加到一个名为 city 的新字符串中,hh 到小时,分钟到分钟?
我想:
printf("the flight to %s, is at %s hr and %s mins", cityname, hour, minutes);
我真的很感谢你的帮助提前谢谢你