CrazyEngineers
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • Kaustubh Katdare

    AdministratorOct 7, 2008

    No tries here? Where are our *crazy* computer engineers?
    Are you sure? This action cannot be undone.
    Cancel
  • sauravgoswami

    MemberOct 7, 2008

    well its possible to write a programme to generate source codes,and it is possible here too,but the challenge is to generate codes according to the need of the hour,say less memory space,more sturdy,preference of tools so.on...
    Are you sure? This action cannot be undone.
    Cancel
  • sriramchandrk

    MemberOct 9, 2008

    There are 3 types of executable programs (interpreted(basic, perl) , compiled programs (c, pascal) & semi interpreted (java) )

    You can produce its own source code as output only in interpreted programs.

    its possible for semi interpreted using a process called as decompilation but the output may not be exactly same as initial source.

    It not possible for compiled program.

    example for interpreted program using perl.
    =========================

    #!/usr/bin/perl

    open(INFILE, $0);
    while(<INFILE>)
    {
    print "$_";
    }

    =========================

    Thanks & Regards
    Sriram
    Are you sure? This action cannot be undone.
    Cancel
  • aashu_itdude

    MemberOct 10, 2008

    this c++ code reads the source file and displays the code as output. Its not a perfect code for this query but it can be further developed.

    #include<iostream.h>
    #include<conio.h>
    #include<stdio.h>
    #include<fstream.h>
    void main()
    {
    clrscr();
    int c=0;
    char a[238];
    ifstream fin("out.cpp"); //name of program
    while(!fin.eof())
    {
    fin.read(a,238);
    }
    puts(a);
    getch();
    }
    Are you sure? This action cannot be undone.
    Cancel
  • emYth

    MemberOct 12, 2008

    Assuming that the source file names test.cpp

    #include<iostream>
    #include<string>
    using namespace std;
    
    int main()
    {
        freopen("test.cpp","rt",stdin);
        string g;
        while(getline(cin,g)&&cin)
        {
          cout<<g<<endl;
        }
        return 0;
    }
    
    Are you sure? This action cannot be undone.
    Cancel
  • Predictor

    MemberFeb 23, 2010

    sriramchandrk
    There are 3 types of executable programs (interpreted(basic, perl) , compiled programs (c, pascal) & semi interpreted (java) )
    ...but there have been BASIC compilers and C interpreters. ???


    -Will Dwinnell
    <a href="https://matlabdatamining.blogspot.com/" target="_blank" rel="nofollow noopener noreferrer">Data Mining in MATLAB</a>
    Are you sure? This action cannot be undone.
    Cancel
  • Manish Goyal

    MemberFeb 23, 2010

    import java.io.*;
    class Source
    {
    public static void main(String args[])throws IOException
    {
    FileReader fr=new FileReader("Source.java");
    int c;
    while((c=fr.read())!=-1)
    {
    System.out.print((char)c);
    }
    }
    }
    
    
    Are you sure? This action cannot be undone.
    Cancel
  • malardevi

    MemberFeb 23, 2010

    prakash.athani
    Can anyone think about it and post replies?
    I think try it by using the same file name in that program. open the same file read it and then print it. just try it.
    Are you sure? This action cannot be undone.
    Cancel
  • trishna05

    MemberJun 28, 2012

    #include <stdio.h>
    char*s="#include <stdio.h>%c char*s=%c%s%c;%c int main(void){printf(s,10,34,s,34,10,10);}";
    int main(void)
    {
    printf(s,10,34,s,34,10,10);
    }
    Are you sure? This action cannot be undone.
    Cancel
  • Sahithi Pallavi

    MemberJun 28, 2012

    😕 😲 😒

    PS : sorry for spamming.
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register