La différence entre .cc et .cpp

C++ -  
mira24 Posted messages 139 Status Member -
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. kilian Posted messages 8675 Registration date   Status Moderator Last intervention   1 526
     
    It seems to me that .cc is a C++ extension that works under g++ (the C++ compiler of gcc).
    2
    1. C++
       
      So how to compile them under Visual?
      0
    2. luffy duck > C++
       
      Rename them to .cpp using the utilities I provided you earlier. I believe it's the only solution.
      0
    3. C++ > luffy duck
       
      Sure, 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
      :)
      0
    4. kilian Posted messages 8675 Registration date   Status Moderator Last intervention   1 526 > C++
       
      Try Dev C++ if you want. The cc extensions will work with it.
      0
    5. luffy duck > kilian Posted messages 8675 Registration date   Status Moderator Last intervention  
       
      ou g++ for Windows ^^
      0
  2. luffy duck
     
    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
    1. C++
       
      Thank you for your help
      but can I know why it won't open ??!!
      what is a .cc file then?
      that's weird!!
      0
  3. kilian Posted messages 8675 Registration date   Status Moderator Last intervention   1 526
     
    Hi,

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

    apparently it should work under Visual as well. Is there an error message?
    0
    1. C++
       
      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!!
      0
  5. luffy duck
     
    Eh bien, écris-toi un petit script pour renommer tes fichiers en .cpp, ce sera plus propre comme ça ;-)
    0
    1. C++
       
      and how is that? I'm sorry, I didn't quite understand what you mean!
      thank you for clarifying a bit!
      0
  6. luffy duck
     
    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?
    0
    1. C++
       
      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
      0
  7. luffy duck
     
    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.
    0
  8. C++
     
    So what should I choose?
    Which version is the easiest to use?
    0
  9. kilian Posted messages 8675 Registration date   Status Moderator Last intervention   1 526
     
    Dev C++
    0
    1. C++
       
      oooooook then!!
      I'm actually downloading it! ;-)
      0
    2. C++
       
      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.
      0
      1. kilian Posted messages 8675 Registration date   Status Moderator Last intervention   1 526 > C++
         
        Yes, of course :-)
        0
      2. C++ > C++
         
        Thank you for all the help :-)

        Note: Apparently, a .cc file only opens correctly on Linux!
        0
      3. mira24 Posted messages 139 Status Member 3 > 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
        0