C++ Practice Projects

This is a discussion on C++ Practice Projects within the C++ Programming forums, part of the General Programming Boards category; Everyone pitch in and post their favorite practice programs to refresh their memories or the programs they first made when ...

  1. #1
    Registered User
    Join Date
    Feb 2006
    Posts
    14

    C++ Practice Projects

    Everyone pitch in and post their favorite practice programs to refresh their memories or the programs they first made when starting off, it would really help out with all the people wondering what to make for practice (myself included).

    Would be very helpful, thanks

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,494
    I used to create excessive numbers of hex dump programs

    Like this, only with less features
    http://www.hmug.org/man/1/od.php
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Jun 2006
    Posts
    29
    I create programs with no real meaning - a login program to somewhere that isnt exists (to practice files I/O) and all kind of "Hello World" in difrent ways - open gl, normal window, files etc....

  4. #4
    Registered User
    Join Date
    Jan 2006
    Posts
    9
    Not exactly something for beginners, but I'm attempting to make an IRC daemon. Just try making your own equivalent of programs you often use. Then you can add features to it that the original program didn't have and be able to enjoy the program yourself.

  5. #5
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,438
    I don't try to write full programs. Just create snippets of code as I go along to try and understand the concepts I'm learning.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  6. #6
    Registered User
    Join Date
    Apr 2006
    Posts
    132
    Tic Tac To , Blackjack, Guess the number, cat and dog converters, calculators, they are what i started with.

  7. #7
    Registered User
    Join Date
    Mar 2006
    Posts
    725
    Intermediate: big prime generators, expression calculators, interpreters, simple shells... hey, if you don't try, you never learn.

    You can also try write some games with AI (tic-tac-toe, pong, etc) for fun and stress relief.
    Code:
    #include <stdio.h>
    
    void J(char*a){int f,i=0,c='1';for(;a[i]!='0';++i)if(i==81){
    puts(a);return;}for(;c<='9';++c){for(f=0;f<9;++f)if(a[i-i%27+i%9
    /3*3+f/3*9+f%3]==c||a[i%9+f*9]==c||a[i-i%9+f]==c)goto e;a[i]=c;J(a);a[i]
    ='0';e:;}}int main(int c,char**v){int t=0;if(c>1){for(;v[1][
    t];++t);if(t==81){J(v[1]);return 0;}}puts("sudoku [0-9]{81}");return 1;}

  8. #8
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,262
    Hey, you should make something which puts the correct code tags on some c/c++ code. It's not all that hard, but it may be a good thing to try.

    or you could do something like this: this where the user inputs something like:

    3*5-1

    and the program gets the result (14).
    Last edited by twomers; 06-19-2006 at 03:10 PM.

  9. #9
    Registered User
    Join Date
    Jul 2003
    Posts
    450
    I just created a simple conversion program. But I do it so it is fail safe. I also have done it with different GUI APIs to see how the values are changed for instance qt can be made to accept only numbers as input but the range is different then doing it using standard C++ as a console app.

    When I learned more I was interested in implementing different data structures like binary trees.

    Later I started learning about Design Patterns and created a program about beer inventories that used one of these patterns.

    To learn about networking and threads I created a simple client server program. It may be simplest to just create a ping program.

    Because I haven't done anything in so long this is a good thread for me because I have forgotten most of what I did.

    If you are interested in recursion try doing the chess board queens problem without looking it up. I'm not sure the exact name 12 queens?

  10. #10
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,666
    It's called the eight queens problem: arrange all the queens on the board so that none of the pieces are attacking each other.

    > created a program about beer inventories that used one of these patterns.
    All my programs are going to involve beer in some way from now on I think.

  11. #11
    Registered User
    Join Date
    May 2011
    Posts
    1
    If you know another language like Italian, French, or Spanish, you can make a verb conjugater. You have file I/O, exceptions to handle, and output to manipulate with menus for different tenses. I'm working on one right now in fact.

  12. #12
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,494
    @globalRick - please read the forum rules, this thread is 5 years old.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Projects board
    By VirtualAce in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 12-13-2004, 08:33 AM
  2. Beginner projects
    By MagSteve in forum C++ Programming
    Replies: 4
    Last Post: 05-05-2004, 02:04 AM
  3. Looking for some big C/C++ projects
    By C-Dumbie in forum C Programming
    Replies: 5
    Last Post: 09-16-2002, 12:18 AM
  4. Practice
    By Octorok101 in forum C++ Programming
    Replies: 1
    Last Post: 07-02-2002, 03:14 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21