Thread: Looking to learn C++

  1. #16
    I Write C++ Apps, Sue Me.
    Join Date
    Feb 2006
    Location
    In My Computer
    Posts
    44
    Quote Originally Posted by ahluka
    [email protected]
    Usually between 9am and 10pm. Usually
    I'm on now.
    never use your email address like that. Spambots pick it up and will spam you.

    do:

    ahluka_lt "at" hotmail "dot" com

    -Kyle

  2. #17
    Supermassive black hole cboard_member's Avatar
    Join Date
    Jul 2005
    Posts
    1,709
    I never thought of that. It's ok I get enough variations of spam in there anyway so a bit more won't hurt.
    Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.

    - Mike McShaffry

  3. #18
    Registered User
    Join Date
    Mar 2006
    Posts
    725
    To [email protected]: Fr33 v!4gRa N0w!



    I'm SURE I'm gonna regret doing this, but...
    jafet .^. at .:. vixle .!. Dotcom



    I can tell you, I haven't even started Windows GUI yet! You need to be patient, and work on things you're capable of. Even the most senior programmers here (or anywhere else) aren't perfect, and still make mistakes, and don't know how to make a Doom IV clone. I'm talking about 20+ years programming experience here. So don't be too quick on the draw either.
    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;}

  4. #19
    Supermassive black hole cboard_member's Avatar
    Join Date
    Jul 2005
    Posts
    1,709
    Quote Originally Posted by jafet
    To [email protected]: Fr33 v!4gRa N0w!



    I'm SURE I'm gonna regret doing this, but...
    jafet .^. at .:. vixle .!. Dotcom



    I can tell you, I haven't even started Windows GUI yet! You need to be patient, and work on things you're capable of. Even the most senior programmers here (or anywhere else) aren't perfect, and still make mistakes, and don't know how to make a Doom IV clone. I'm talking about 20+ years programming experience here. So don't be too quick on the draw either.
    1

    I think it's probably best you take Salem's advice regarding an interpreted language.
    Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.

    - Mike McShaffry

  5. #20
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,688
    What do you thinks looks easier to learn:

    This is BASIC

    Code:
    10 print "Hello welcome to programming in BASIC"
    20 print"What is your name?"
    30 INPUT A$
    40 HELLO A$
    50 END
    60 RUN
    This is C

    Code:
    #include <stdio.h>
    
    int main()
    {
    char name[15];
    
    printf("Hello welcome to programming in C);
    printf("What is your name ");
    scanf("%s", &name);
    printf("Hello %s", name);
    
    getchar();
    
    return 0;
    }
    This is C++

    Code:
    #include <iostream>
    #include <string>
    
    using namespace std;
    
    int main()
    {
    string name;
    
    cout << "Hello, welcome to Programming in C++" << endl;
    cout << "What is your name? ";
    cin >> name;
    cout << "Hello " << name << endl;
    
    cin.ignore();
    getchar();
    
    return 0;
    }
    BASIC is very easy to learn, C and C++ take more time - pick what language suits your
    needs more

  6. #21
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    I hope that mistake in the C program was intentional.
    And I don't mean the missing " either
    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.

  7. #22
    Registered User
    Join Date
    Nov 2005
    Posts
    545
    Is the mistake by any chance the getchar() ?

  8. #23
    Supermassive black hole cboard_member's Avatar
    Join Date
    Jul 2005
    Posts
    1,709
    You used name without initialising it, scanf and printf are evil. I'm one of those people who know they are but not too sure why - someone else will fill it in. I'm sure.
    Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.

    - Mike McShaffry

  9. #24
    Registered User
    Join Date
    Nov 2005
    Posts
    545
    I thought getchar(); needed some other include file.

  10. #25
    Supermassive black hole cboard_member's Avatar
    Join Date
    Jul 2005
    Posts
    1,709
    No idea I never use it.
    Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.

    - Mike McShaffry

  11. #26
    Registered User
    Join Date
    Apr 2006
    Posts
    13
    Ak, you coming on msn?

  12. #27
    Registered User
    Join Date
    Mar 2006
    Posts
    725
    Code:
    #include <stdio.h>
    
    int main()
    {
    char name[15];
    
    puts("Hello welcome to programming in C");
    puts("What is your name ?");
    fgets(name, 15, stdin);
    printf("Hello %s", name);
    
    getchar();
    
    return 0;
    }

    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;}

  13. #28
    Supermassive black hole cboard_member's Avatar
    Join Date
    Jul 2005
    Posts
    1,709
    Code:
    #include <stdio.h>
    
    int main()
    {
    char name[15] = {0};
    
    puts("Hello welcome to programming in C");
    puts("What is your name ?");
    fgets(name, 15, stdin);
    printf("Hello %s", name);
    
    getchar();
    
    return 0;
    }
    Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.

    - Mike McShaffry

  14. #29
    Registered User
    Join Date
    Mar 2006
    Posts
    725
    Code:
    #include <stdio.h>
    
    int main()
    {
    char name[15];
    
    puts("Hello welcome to programming in C");
    puts("What is your name ?");
    fgets(name, 15, stdin);
    printf("Hello %s", name);
    
    getchar();
    
    return 0;
    }

    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;}

  15. #30
    Supermassive black hole cboard_member's Avatar
    Join Date
    Jul 2005
    Posts
    1,709
    Let's just agree to disagree.
    Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.

    - Mike McShaffry

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how long to learn c programming
    By cmay in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 05-13-2009, 12:55 AM
  2. Do you ever try to learn too much?
    By Stonehambey in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 06-17-2008, 07:55 AM
  3. You have to learn C in order to learn C++
    By gandalf_bar in forum A Brief History of Cprogramming.com
    Replies: 20
    Last Post: 07-16-2004, 10:33 AM
  4. Novice trying to learn C++
    By dead in forum C++ Programming
    Replies: 10
    Last Post: 12-01-2003, 09:25 PM
  5. Advice on how to being to learn C++
    By VenomUK in forum C++ Programming
    Replies: 9
    Last Post: 05-18-2002, 01:06 PM