Thread: NEED HELP! Writing an elementary C++ program

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    Always initialize your variables. I would prefer to declare your variables only when you're ready to initialize and or use them, which also helps remind you of that rule. That might help you here.

    You also might want to think about how many times your for loop runs, but that's probably not your current problem. Basically, you've made a couple changes from your original attempt that made things worse.

  2. #2
    Registered User
    Join Date
    Jun 2016
    Posts
    3
    Thanks. I went back to my original code and I figured it out. I was trying to over-complicate it for sure.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Elementary question
    By Dan. in forum C++ Programming
    Replies: 1
    Last Post: 03-02-2011, 01:47 PM
  2. Very elementary C++ question
    By Dondrei in forum C++ Programming
    Replies: 13
    Last Post: 07-28-2008, 09:00 AM
  3. elementary networking problem
    By nash@nitk in forum Networking/Device Communication
    Replies: 2
    Last Post: 06-26-2006, 10:21 PM
  4. An Elementary Windows Question
    By samGwilliam in forum Windows Programming
    Replies: 7
    Last Post: 01-20-2006, 04:20 PM
  5. elementary question
    By misplaced in forum Tech Board
    Replies: 8
    Last Post: 12-17-2004, 07:27 AM

Tags for this Thread