Public

This is a discussion on Public within the C++ Programming forums, part of the General Programming Boards category; Lol, hardly everything. I've been doing C++ for 12 years now, and I own a lot of books (the internet ...

  1. #16
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    Lol, hardly everything. I've been doing C++ for 12 years now, and I own a lot of books (the internet is a good resource, but you can't get the equivalent of a good 800 page book). Further, I try to keep up with Guru of the Week and other writings of experts like Sutter.

  2. #17
    Grammar Police HybridM's Avatar
    Join Date
    Jan 2003
    Posts
    355
    Where can I check out these Guru of the week articles?
    Thor's self help tip:
    Maybe a neighbor is tossing leaf clippings on your lawn, looking at your woman, or harboring desires regarding your longboat. You enslave his children, set his house on fire. He shall not bother you again.

    OS: Windows XP
    Compiler: MSVC

  3. #18
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    http://www.gotw.ca/ is the official homepage.

    He also made 60some of those articles into two books (with revised, updated, and expanded solutions), Exceptional C++ and More Exceptional C++.

    I agree with almost everything he has said in those articles, the one exception being his case-insensitive string class. There are better ways to accomplish his goal without creating a new type of string, and it doesn't make sense to make your string responsible for how compares work; it should be the job of a custom comparison function. I think Matt Austern has a better solution (on the web somewhere) although it should be templatized so that it can handle wide strings as well (I have done this).

  4. #19
    Grammar Police HybridM's Avatar
    Join Date
    Jan 2003
    Posts
    355
    Thanks for the link, do you work in programming or just a hobby? If so, what do you do? I'm still unsure of whether I want to code as a career or hobby.
    Thor's self help tip:
    Maybe a neighbor is tossing leaf clippings on your lawn, looking at your woman, or harboring desires regarding your longboat. You enslave his children, set his house on fire. He shall not bother you again.

    OS: Windows XP
    Compiler: MSVC

  5. #20
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    A long hobby which will help my career. I'm actually still in college (Ph.D. student), I've been programming C since I was 10 and C++ since 11. I chose not to go into computer science, preferring engineering -- I like building electronic hardware -- but I also program quite a lot, as often the projects I work on lack critical development tools (or I didn't have access to any). One recent example I worked on was a PCMCIA card. PCMCIA cards have a ROM on the chip that holds information about the card (CIS). Now, with the PCMCIA specification, I could have simply gone and written the CIS in hex by hand, but that would be a royal pain, so I made a simple GUI to add and remove properties from a file, and it would create the image I needed to flash the ROM.

    I've taken plenty of CS courses, I've had to write code in languages ranging from Java at the high-level side to machine code (written using a hex editor) at the low level side. CS seems like a perfectly good major; I practically did major in it for the number of courses I took.

    Having done some job interviewing, my programming experience was widely talked about and was seen as a positive thing by my would-be recruiters, so it's good to have, even if it's not your career.

    Oh, another good site: http://www.cuj.com.

  6. #21
    carry on JaWiB's Avatar
    Join Date
    Feb 2003
    Location
    Seattle, WA
    Posts
    1,972

    Talking

    Wow, I used to want to be an engineer, but now that I'm into programming I would like to make games as a career. Who knows it seems like there's a good change my career path will change and now I know that programming may come in handy if it does...but that's a long way away
    "Think not but that I know these things; or think
    I know them not: not therefore am I short
    Of knowing what I ought."
    -John Milton, Paradise Regained (1671)

    "Work hard and it might happen."
    -XSquared

  7. #22
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    Hmmm. I may have been simplifying it too much. I believe I first ran into the problem of multiple declarations/definitions when including header files IN header files. I just assumed it also applied to multiple source files. I guess not. I think it would still be a good idea to use header guards though. It's only three lines of code, and maybe a thousandth of a second added on to the compile time.

    As for programming experience, I started GW-BASIC at about 10, moved to QBASIC, Visual Basic, to Visual C, then Visual C++. I'm now 16 and have been programming VC++ for a couple years. I'm seriously thinking of studying computer science at university, maybe hardware, maybe software. I really like to understand how the computer works, at both the hardware and software levels. What would you recommend I do?
    benforbes@optusnet.com.au
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

  8. #23
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    It's always a good idea to have them, no matter what.

    And the real question becomes, what do YOU want to do? I can tell you what I did with my life, what choices I made, what motivates me, but that's irrelevant. What motivates you? What do YOU want?

    If you don't know, based on your stated interests, I think you might want to start out with a double major in electrical engineering and computer science. The two overlap in about 75% of their curriculum anyway, so it's easy. And if you find you really only want one or the other, change majors.

  9. #24
    Registered User
    Join Date
    Jul 2003
    Posts
    450
    Just a note, are we talking about linkage internal, external or scope. Isn't Public an access modifer that controls scope? Static variables persist for the length of a program. External variables (which are static) have external linkage and file scope(global) are known to all files of a program. If you want to limit scope to only functions within a single file it must be declared as extern static.

    Correct me if I am missing somthing or am way off base.

  10. #25
    Confused
    Join Date
    Nov 2002
    Location
    Warwick, UK
    Posts
    209
    Code:
    //main.h
    #ifndef mainHeader
    #define mainHeader
    
    int main();
    LRESULT CALLBACK WndProc();
    
    #endif
    So you use the #ifndef and the rest in the header that's included multiple times ? And what's your LRESULT CALLBACK in main() ?

  11. #26
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    So you use the #ifndef and the rest in the header that's included multiple times ? And what's your LRESULT CALLBACK in main() ?
    I always use header guards, but yeah, you don't have to do them if the header is only #included once.

    The LRESULT CALLBACK WndProc() line was just showing that you include prototypes in header files. If you mean, "What does LRESULT CALLBACK mean", then here it is. LRESULT is the return type of the function (the window procedure). It's #defined as a long int. CALLBACK specifies the calling method, and it is #defined as __stdcall. Don't ask me about calling methods, I don't really get it.
    benforbes@optusnet.com.au
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

  12. #27
    Confused
    Join Date
    Nov 2002
    Location
    Warwick, UK
    Posts
    209
    Alright thanks, that helped.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reading Process Memory
    By polydegmon in forum C# Programming
    Replies: 0
    Last Post: 05-26-2009, 08:18 AM
  2. OOP Question DB Access Wrapper Classes
    By digioz in forum C# Programming
    Replies: 2
    Last Post: 09-07-2008, 05:30 PM
  3. Linking problems in Visual Studio
    By h3ro in forum C++ Programming
    Replies: 5
    Last Post: 03-04-2008, 02:39 PM
  4. Stuck with Structs...
    By DanFraser in forum C# Programming
    Replies: 8
    Last Post: 05-03-2007, 10:55 AM
  5. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 01:13 AM

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