CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 19

Threaded View

  1. #14
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: Printing patterns

    Quote Originally Posted by ttrz View Post
    Code:
    printf("%c         %c\n", '*', '*');
    While this will work, substituting literals is really not necessary here:
    Code:
    printf("*         *\n");
    will do the same thing.

    Quote Originally Posted by adam86107 View Post
    The instructor referred to it as a C++ class anyway.
    Well, to be blunt, there are a lot of instructors who claim to be teaching C++, who are actually teaching "C with a few bits of C++ syntax thrown in". That isn't the way professional programmers write C++, but it is unfortunately very common in schools. The reason for this is that C makes it easier to teach the underlying data structures and algorithms than proper C++, because proper C++ does a lot of the low-level stuff for you. It's important to learn those low-level ideas, but you should also become familiar with the "right" way of doing things, because it's both easier and safer.
    Last edited by Lindley; October 18th, 2010 at 12:29 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured