Closed. This question needs details or clarity。它当前不接受答案。
                            
                        
                    
                
                            
                                
                
                        
                            
                        
                    
                        
                            想改善这个问题吗?添加详细信息并通过editing this post阐明问题。
                        
                        3年前关闭。
                                                                                            
                
        
我想暂时在指针中前进,所以不想立即使用*s++;。我如何暂时将指针向前移动?我认为这对int x[5]; int i = 0; x[i+1];来说是件好事。

const char *buffer;
const char *s = buffer;
char a;
char b;
if(*s == '/' && *s + 1 == '*')
{
    a = *s;
    parser_comment_level++;
    *s++;
    a = *s;
    *s++;
    a = *s;
    }
if(*s == '*' && *s + 1 == '/')
{
    a = *s;
    parser_comment_level--;
    *s++;
    a = *s;
    *s++;
    a = *s;
    }
*s++;

最佳答案

您是否正在寻找这样的东西:*(s+1)

关于c - 暂时在指针中前进,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/35590871/

10-11 12:29