Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. delete

delete

Scheduled Pinned Locked Moved C / C++ / MFC
29 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nhqlbaislwfiikqraqnm
    wrote on last edited by
    #1

    delete

    L R 2 Replies Last reply
    0
    • N nhqlbaislwfiikqraqnm

      delete

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      I am not sure that I understand your question but if you have Visual Studio 2010 then you can code in C, C++ or C#. Perhaps you could rephrase your question or show the code that you are having trouble with.

      It's time for a new signature.

      N 1 Reply Last reply
      0
      • L Lost User

        I am not sure that I understand your question but if you have Visual Studio 2010 then you can code in C, C++ or C#. Perhaps you could rephrase your question or show the code that you are having trouble with.

        It's time for a new signature.

        N Offline
        N Offline
        nhqlbaislwfiikqraqnm
        wrote on last edited by
        #3

        How can i code/compile C? What project i must open?

        R L L 3 Replies Last reply
        0
        • N nhqlbaislwfiikqraqnm

          delete

          R Offline
          R Offline
          rp_suman
          wrote on last edited by
          #4

          Here are some references: Walkthrough: Compiling a C Program[^] C-Language Programming with Visual Studio 2010 Ultimate, Pro or VC++ Express[^] C-language programming in Visual Studio 2010[^] Are you meaning this problem: Compile C program in Visual Studio 2005[^] ?

          -- "Programming is an art that fights back!"

          N 1 Reply Last reply
          0
          • R rp_suman

            Here are some references: Walkthrough: Compiling a C Program[^] C-Language Programming with Visual Studio 2010 Ultimate, Pro or VC++ Express[^] C-language programming in Visual Studio 2010[^] Are you meaning this problem: Compile C program in Visual Studio 2005[^] ?

            -- "Programming is an art that fights back!"

            N Offline
            N Offline
            nhqlbaislwfiikqraqnm
            wrote on last edited by
            #5

            Walkthrough: Compiling a C Program Like this link works the compiller but so i must write the code with notepad or an editor. But how can i make a new projekt in VS10 and compile it there, so as with C#. What i must do? I open a new project then ?

            N R 2 Replies Last reply
            0
            • N nhqlbaislwfiikqraqnm

              How can i code/compile C? What project i must open?

              R Offline
              R Offline
              rp_suman
              wrote on last edited by
              #6

              Which version of Visual Studio do you have? Ultimate / Pro or VC++ Express? Please check my other reply to this question.

              -- "Programming is an art that fights back!"

              N 1 Reply Last reply
              0
              • N nhqlbaislwfiikqraqnm

                How can i code/compile C? What project i must open?

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                PC17 wrote:

                What project i must open?

                Just start a new project and select either Console or Windows app, VS will create a skeleton project for you to add your own code and will automatically select the correct compiler options. If you do not know how to use Visual Studio then take a look at some of the self study guides on the start page.

                It's time for a new signature.

                1 Reply Last reply
                0
                • N nhqlbaislwfiikqraqnm

                  How can i code/compile C? What project i must open?

                  L Offline
                  L Offline
                  Luc Pattyn
                  wrote on last edited by
                  #8

                  what I do (using VS Express) in such case is create a C++ project of the kind you want, then add a file with extension .c and finally remove the ones with extension .cpp; I typically also have to change the settings about precompiled headers. I wish there were an easier way, but I don't see one. :)

                  Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

                  Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

                  L N 2 Replies Last reply
                  0
                  • L Luc Pattyn

                    what I do (using VS Express) in such case is create a C++ project of the kind you want, then add a file with extension .c and finally remove the ones with extension .cpp; I typically also have to change the settings about precompiled headers. I wish there were an easier way, but I don't see one. :)

                    Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

                    Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    Luc Pattyn wrote:

                    I wish there were an easier way

                    You can write pure C in a .cpp source file.

                    It's time for a new signature.

                    L C 2 Replies Last reply
                    0
                    • L Luc Pattyn

                      what I do (using VS Express) in such case is create a C++ project of the kind you want, then add a file with extension .c and finally remove the ones with extension .cpp; I typically also have to change the settings about precompiled headers. I wish there were an easier way, but I don't see one. :)

                      Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

                      Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

                      N Offline
                      N Offline
                      N a v a n e e t h
                      wrote on last edited by
                      #10

                      Luc Pattyn wrote:

                      I typically also have to change the settings about precompiled headers.

                      And say the compiler to use C. On the project properties set "Compile as C".

                      Luc Pattyn wrote:

                      I wish there were an easier way, but I don't see one.

                      Much easier way is to create an empty project and add your files. There change the extension when you add. :)

                      Best wishes, Navaneeth

                      L 1 Reply Last reply
                      0
                      • R rp_suman

                        Which version of Visual Studio do you have? Ultimate / Pro or VC++ Express? Please check my other reply to this question.

                        -- "Programming is an art that fights back!"

                        N Offline
                        N Offline
                        nhqlbaislwfiikqraqnm
                        wrote on last edited by
                        #11

                        Ultimate Demo

                        1 Reply Last reply
                        0
                        • N nhqlbaislwfiikqraqnm

                          Walkthrough: Compiling a C Program Like this link works the compiller but so i must write the code with notepad or an editor. But how can i make a new projekt in VS10 and compile it there, so as with C#. What i must do? I open a new project then ?

                          N Offline
                          N Offline
                          N a v a n e e t h
                          wrote on last edited by
                          #12

                          Choose "Empty project". When adding files, specify extension as C (actually extension doesn't matter). Now on the project properties, choose "Compile as C" option.

                          Best wishes, Navaneeth

                          N C 2 Replies Last reply
                          0
                          • N N a v a n e e t h

                            Luc Pattyn wrote:

                            I typically also have to change the settings about precompiled headers.

                            And say the compiler to use C. On the project properties set "Compile as C".

                            Luc Pattyn wrote:

                            I wish there were an easier way, but I don't see one.

                            Much easier way is to create an empty project and add your files. There change the extension when you add. :)

                            Best wishes, Navaneeth

                            L Offline
                            L Offline
                            Luc Pattyn
                            wrote on last edited by
                            #13

                            N a v a n e e t h wrote:

                            set "Compile as C".

                            I never did that, it seems to know from the extension (as it should IMO).

                            N a v a n e e t h wrote:

                            create an empty project

                            ah. of course. I'll have to remember that. thanks. :)

                            Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

                            Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

                            N D 2 Replies Last reply
                            0
                            • L Lost User

                              Luc Pattyn wrote:

                              I wish there were an easier way

                              You can write pure C in a .cpp source file.

                              It's time for a new signature.

                              L Offline
                              L Offline
                              Luc Pattyn
                              wrote on last edited by
                              #14

                              that is a shocking idea, probably correct, but shocking nonetheless. why would I drag the wrong extension with me? :)

                              Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

                              Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

                              1 Reply Last reply
                              0
                              • N nhqlbaislwfiikqraqnm

                                Walkthrough: Compiling a C Program Like this link works the compiller but so i must write the code with notepad or an editor. But how can i make a new projekt in VS10 and compile it there, so as with C#. What i must do? I open a new project then ?

                                R Offline
                                R Offline
                                rp_suman
                                wrote on last edited by
                                #15

                                New Project -> Visual C++ -> Empty Project In Solution Explorer window, right click & select "Source Files" -> "Add" -> "New Item" On left side of the "Add new item" dialog, select "Code" In the file name field type "YourFileName.c" and click "Add" Write some code in the file like below and press "Ctrl + F5", you can see the output: #include "stdio.h" int main() { int nNum = 10; char cChar = 'a'; printf("%d", nNum); printf("\n"); printf("%c", cChar); printf("\n"); return 0; } Regards

                                -- "Programming is an art that fights back!"

                                N 1 Reply Last reply
                                0
                                • N N a v a n e e t h

                                  Choose "Empty project". When adding files, specify extension as C (actually extension doesn't matter). Now on the project properties, choose "Compile as C" option.

                                  Best wishes, Navaneeth

                                  N Offline
                                  N Offline
                                  nhqlbaislwfiikqraqnm
                                  wrote on last edited by
                                  #16

                                  I can´t chose "Compile as C" Where is that precisly?

                                  R 1 Reply Last reply
                                  0
                                  • N nhqlbaislwfiikqraqnm

                                    I can´t chose "Compile as C" Where is that precisly?

                                    R Offline
                                    R Offline
                                    rp_suman
                                    wrote on last edited by
                                    #17

                                    "Project" menu -> Properties(last menu) -> C/C++ -> Advanced -> In right side "Compile As" -> "Compile as C Code(/TC)".

                                    -- "Programming is an art that fights back!"

                                    1 Reply Last reply
                                    0
                                    • R rp_suman

                                      New Project -> Visual C++ -> Empty Project In Solution Explorer window, right click & select "Source Files" -> "Add" -> "New Item" On left side of the "Add new item" dialog, select "Code" In the file name field type "YourFileName.c" and click "Add" Write some code in the file like below and press "Ctrl + F5", you can see the output: #include "stdio.h" int main() { int nNum = 10; char cChar = 'a'; printf("%d", nNum); printf("\n"); printf("%c", cChar); printf("\n"); return 0; } Regards

                                      -- "Programming is an art that fights back!"

                                      N Offline
                                      N Offline
                                      nhqlbaislwfiikqraqnm
                                      wrote on last edited by
                                      #18

                                      Yes i did it so then he write: The Application "c:\Pfad..." can´t start. The System couldn´t the file. Where can i set the Compiler? I can´t set it.

                                      1 Reply Last reply
                                      0
                                      • L Luc Pattyn

                                        N a v a n e e t h wrote:

                                        set "Compile as C".

                                        I never did that, it seems to know from the extension (as it should IMO).

                                        N a v a n e e t h wrote:

                                        create an empty project

                                        ah. of course. I'll have to remember that. thanks. :)

                                        Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

                                        Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

                                        N Offline
                                        N Offline
                                        N a v a n e e t h
                                        wrote on last edited by
                                        #19

                                        Luc Pattyn wrote:

                                        it seems to know from the extension (as it should IMO).

                                        I don't think so. On default settings it uses C++ compiler to compile the code irrespective of what extension it is. You can see this from the output window. This will work because most of the C code is also valid on C++. When you set the "Compile as C" option, you can see adiitional compiler flag getting added to the compile command and it defaults to the C89 standard. :)

                                        Best wishes, Navaneeth

                                        L 2 Replies Last reply
                                        0
                                        • L Luc Pattyn

                                          N a v a n e e t h wrote:

                                          set "Compile as C".

                                          I never did that, it seems to know from the extension (as it should IMO).

                                          N a v a n e e t h wrote:

                                          create an empty project

                                          ah. of course. I'll have to remember that. thanks. :)

                                          Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

                                          Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

                                          D Offline
                                          D Offline
                                          David Crow
                                          wrote on last edited by
                                          #20

                                          Luc Pattyn wrote:

                                          ...it seems to know from the extension (as it should IMO).

                                          It always has for me. I've never changed compiler options when switching between C and CPP files.

                                          "One man's wage rise is another man's price increase." - Harold Wilson

                                          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                                          "Man who follows car will be exhausted." - Confucius

                                          L 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups