how to read scanf with spaces
        Posted  
        
            by Matias
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Matias
        
        
        
        Published on 2010-04-27T04:52:57Z
        Indexed on 
            2010/04/27
            5:03 UTC
        
        
        Read the original article
        Hit count: 404
        
I'm having a weird problem
i'm trying to read a string from a console with scanf()
like this
scanf("%[^\n]",string1);
but it doesnt read anything. it just skips the entire scanf.
I'm trying it in gcc compiler
© Stack Overflow or respective owner