La différence entre .cc et .cpp

Hello,
can someone tell me the difference between a .cc file and a .cpp file
because I'm having trouble compiling a .cc file on Visual C++. How can I get them to compile????
thank you for your help
Configuration: Windows XP Firefox 2.0.0.13

9 answers

  1. Moderator
    It seems to me that .cc is a C++ extension that works under g++ (the C++ compiler of gcc).
    1. So how to compile them under Visual?
    2. @C++Rename them to .cpp using the utilities I provided you earlier. I believe it's the only solution.
    3. @luffy duckSure, here is the translation: Ok, so I need to rename them all,
      but if I change the Visual compiler to another one, I think it will work, right?
      Can you give me an example of a compiler and where to find it?
      Thank you infinitely for all your help
      :)
    4. Moderator
      @C++Try Dev C++ if you want. The cc extensions will work with it.
  2. Well, if it works with ".cpp" files, you can write a small batch script to rename your files and give them a .cpp extension

    or there are already existing utilities:

    https://www.gratuiciel.com/gratuit/systeme_autres/

    because it's even nicer to have source files with the .cpp extension!!! ^^
    1. Thank you for your help
      but can I know why it won't open ??!!
      what is a .cc file then?
      that's weird!!
  3. Moderator
    Hi,

    There doesn’t seem to be any difference (at least for compilers like g++). As for Visual, I don't know.
    1. Hi,

      apparently it should work under Visual as well. Is there an error message?
      1. Yes, it doesn't open correctly; it doesn't recognize this type of file!!
        But when I copy the code and save it as a .cpp file, it works fine
        But I have a lot of .cc files, and it's not practical to save all of them with the .cpp extension to compile them in Visual!!
    2. Eh bien, écris-toi un petit script pour renommer tes fichiers en .cpp, ce sera plus propre comme ça ;-)
      1. and how is that? I'm sorry, I didn't quite understand what you mean!
        thank you for clarifying a bit!
    3. What is a .cc file then?

      To be honest, I had never seen one... Maybe a mix between C and C++, so the coder hesitated between .c and .cpp, and chose something in between ^^

      And the reason he doesn't want to open it, I find that a bit strange... and I don't have Visual on hand to test. Is it the express version?
      1. Well, the version I'm working with is "Microsoft Visual Studio 6.0"
        I found this link but it's still a bit vague anyway!!
        http://www-camden.rutgers.edu/HELP/Documentation/Unix/S50-1118_C.php
    4. Yep, it seems to be that indeed. In the link you provided earlier:
      C++ programs should end with the extensions .C, .cc, .cpp, or .cxx

      and it seems to only be for the compilers: Sun C Compiler, CC, C++ Compiler.
      1. Moderator
        Dev C++
        1. oooooook then!!
          I'm actually downloading it! ;-)
        2. Oui, vous pouvez garder Visual Studio en même temps que Dev C++. Les deux peuvent être installés et utilisés simultanément sur le même ordinateur sans problème.
        3. @C++Thank you for all the help :-)

          Note: Apparently, a .cc file only opens correctly on Linux!
        4. @C++Hello,
          for your case, you can rename your .cc files to .cpp using the command ( REN *.cc *.cpp ) or
          ( RENAME *.cc *.cpp ) and it will rename all the files at once, of course only the files in the same folder!!
          so you can keep your Visual Studio without the need to install Dev C++!!

          good luck