Thread: Programming Challenge (for my school)

  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    5

    Programming Challenge (for my school)

    Hello, I'm new here, I recently learned basic C++ programming and I've been tasked to make a programming challenge for our school activity. I heard from our instructor in my previous school about a program (I can't remember if it was in C++) which displays it's whole code without reading another file (like a text document which has the code). Can this be done with just basic knowledge of C++? If so can you please tell me how to do this? Or if this is an advanced programming problem perhaps you can sugest another challenge which doesn't need advanced programming knowledge.

  2. #2
    Registered User
    Join Date
    Nov 2005
    Posts
    85
    You mean its actual source code??
    if so just read in char by char with cin.get(ch); and open the file as
    ifstream fin(__FILE__);

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,656
    > which displays it's whole code without reading another file
    Yes, they're called quines (you can google that yourself). Coming up with an original one is quite hard to do.

    > Or if this is an advanced programming problem perhaps you can sugest another challenge
    Conway's game of life - you can google that as well.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. I've been slacking off in high school, am I going to hell
    By Silvercord in forum A Brief History of Cprogramming.com
    Replies: 31
    Last Post: 06-01-2003, 01:00 PM
  2. I Hate My School (rant!!!!)
    By Dalren in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 04-03-2003, 07:10 AM
  3. The purpose of school
    By Shadow12345 in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 11-17-2002, 04:12 AM
  4. School Shooting in Germany
    By Golden Bunny in forum A Brief History of Cprogramming.com
    Replies: 27
    Last Post: 04-27-2002, 01:47 PM
  5. Question about going to a technical school
    By Goalie35 in forum C++ Programming
    Replies: 1
    Last Post: 08-30-2001, 11:34 AM