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#
  4. Generating C file using C#

Generating C file using C#

Scheduled Pinned Locked Moved C#
csharpquestion
9 Posts 5 Posters 1 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
    Niungareamit
    wrote on last edited by
    #1

    Hi... I want to develop a C File using C#3.0 which will create the header file with structures, enums, macros..and all other features of the C.. I want to develop a tool in which i have a GUI and i have to select the options from GUI and accordingly i have to create a C file for the same So is it possible in C#3.0?

    L T CPalliniC 5 Replies Last reply
    0
    • N Niungareamit

      Hi... I want to develop a C File using C#3.0 which will create the header file with structures, enums, macros..and all other features of the C.. I want to develop a tool in which i have a GUI and i have to select the options from GUI and accordingly i have to create a C file for the same So is it possible in C#3.0?

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

      Sounds like an IDE. A C-sourcefile is usually in ASCII, meaning that it's plain text. You can compile this source off course, even using an external compiler. Should I imagine a code-generator, or more of a forms-generator?

      I are Troll :suss:

      N 1 Reply Last reply
      0
      • N Niungareamit

        Hi... I want to develop a C File using C#3.0 which will create the header file with structures, enums, macros..and all other features of the C.. I want to develop a tool in which i have a GUI and i have to select the options from GUI and accordingly i have to create a C file for the same So is it possible in C#3.0?

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

        It sounds IDE kind of stuff you are looking for. According to my knowledge currently there is no any existing project or tool available which can assist you. However, it sounds R&D kind of project. HTH

        Jinal Desai - LIVE Experience is mother of sage....

        1 Reply Last reply
        0
        • L Lost User

          Sounds like an IDE. A C-sourcefile is usually in ASCII, meaning that it's plain text. You can compile this source off course, even using an external compiler. Should I imagine a code-generator, or more of a forms-generator?

          I are Troll :suss:

          N Offline
          N Offline
          Niungareamit
          wrote on last edited by
          #4

          thanks for ur reply.. Basically I am doing a project in which i will be designing a GUI and from there by taking the input I want to generate the C code in a file with ".C" extension. I will be using a different compiler to compile that C File. So is it possible?

          L 1 Reply Last reply
          0
          • N Niungareamit

            thanks for ur reply.. Basically I am doing a project in which i will be designing a GUI and from there by taking the input I want to generate the C code in a file with ".C" extension. I will be using a different compiler to compile that C File. So is it possible?

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

            Yup. There's some articles on CodeProject that deal with creating User-Interfaces, in a similar way that Visual Studio works. This[^] site shows how to create Windows and buttons from C. You'd have to generate source-code similar to that on the website. Most compilers can be run from the command-line, so that shouldn't be any problem.

            I are Troll :suss:

            1 Reply Last reply
            0
            • N Niungareamit

              Hi... I want to develop a C File using C#3.0 which will create the header file with structures, enums, macros..and all other features of the C.. I want to develop a tool in which i have a GUI and i have to select the options from GUI and accordingly i have to create a C file for the same So is it possible in C#3.0?

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

              Niungareamit wrote:

              So is it possible in C#3.0?

              My last team leader used to say "everything is possible with software", and I would agree. The question you really need to ask is whether you are able to translate user input selections into a valid C program.

              It's time for a new signature.

              1 Reply Last reply
              0
              • N Niungareamit

                Hi... I want to develop a C File using C#3.0 which will create the header file with structures, enums, macros..and all other features of the C.. I want to develop a tool in which i have a GUI and i have to select the options from GUI and accordingly i have to create a C file for the same So is it possible in C#3.0?

                T Offline
                T Offline
                T M Gray
                wrote on last edited by
                #7

                I would recommend using an XML file to represent your C file. If you manipulate a .c file directly when you add or remove something like and include you have to do a whole lot more to find the correct line and insert or remove the text you want. If you use an XML file you could have an includes node, and in C# you just add and remove nodes to the tree as you please. You can also have class nodes which in turn have method nodes and so on. Then you use XSLT to turn the XML into a .c file.

                1 Reply Last reply
                0
                • N Niungareamit

                  Hi... I want to develop a C File using C#3.0 which will create the header file with structures, enums, macros..and all other features of the C.. I want to develop a tool in which i have a GUI and i have to select the options from GUI and accordingly i have to create a C file for the same So is it possible in C#3.0?

                  CPalliniC Offline
                  CPalliniC Offline
                  CPallini
                  wrote on last edited by
                  #8

                  I don't know why you were downvoted. Of course it is possible and maybe even useful. :)

                  If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                  This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                  [My articles]

                  In testa che avete, signor di Ceprano?

                  D 1 Reply Last reply
                  0
                  • CPalliniC CPallini

                    I don't know why you were downvoted. Of course it is possible and maybe even useful. :)

                    If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                    This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                    [My articles]

                    D Offline
                    D Offline
                    DaveyM69
                    wrote on last edited by
                    #9

                    Agreed :thumbsup:

                    Dave

                    If this helped, please vote & accept answer!

                    Binging is like googling, it just feels dirtier. Please take your VB.NET out of our nice case sensitive forum.(Pete O'Hanlon)
                    BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)

                    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