mac 下 sublime text 运行c++/c 不能使用scanf/cin

{
    "cmd": ["g++", "${file}", "-o", "${file_path}/${file_base_name}"],
    "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
    "working_dir": "${file_path}",
    "selector": "source.c, source.c++",

    "variants":
    [
        {
            "name": "Run",
            "cmd": ["bash", "-c", "g++ '${file}' -o '${file_path}/${file_base_name}' && open -a Terminal.app '${file_path}/${file_base_name}'"]
        }
    ]
}

mac下的terminal +Xcode 十分接近linux/unix下的编程环境,很适合编写c/c++。不过最近发现了一个很好用的编程环境 sublime text,它很适合“健忘”的人,并且因为它有自动填写功能,可以提升编程速度。唯一的缺点是,它无法读取cin,scanf这种从stdin

 加上这句

 

转载于http://blog.csdn.net/cjy29088/article/details/40300361

 

posted @ 2016-09-21 09:56  武略  阅读(2641)  评论(0编辑  收藏  举报