Jump to content

VaultV3

Member
  • Posts

    16
  • Joined

  • Last visited

Reputation Activity

  1. Agree
    VaultV3 reacted to Unimportant in My linked list program works but then crashes   
    The constructor for class 'StudList' is named 'Student' which should not compile. ("ISO C++ forbids declaration of 'student' with no type). If it does compile for you it will result in 'head', 'prev' and 'curr' never beeing initialised to NULL, which might be the cause of your problems.
     
    Correcting this the program compiles and runs fine for me, even when the #include studlist.cpp file is removed from  the main file.
     
    Things that stand out at a quick glance:
    You never test if any of the operations perfomed on the data file succeed. Test if opening it and reading it fail and handle possible failure.
     
    "Node* newNode = new Node();" may throw 'std::bad_alloc' if allocation fails - You never handle it.
    Also, naked new's stand out like a sore thumb. Read up about smart pointers. (std::unique_ptr).
     
    const correctness. Several functions do not change their object's state, such as "StudList::Print" - so it should be const. Drill yourself in const correctness as it is much more important as many ppl think. For example, if another programmer wants to call the "Print" function on a "const StudList" object, he can't, because you forgot to make it const. When the "Print" function is made const afterward any other function using "Print" that is not const itself will give an error. And so it can cascade into a horrorshow when having to fix it afterwards.
     
    Try to not include namespaces in header files (using namespace x). It results in the namespace beeing included in every code file that uses the header, which quickly results in a namespace mess in larger programs.
  2. Agree
    VaultV3 reacted to Nineshadow in C++ Linked Lists Etiquette Question   
    Templates. Make a linked list class template, and use one with a suitable structure.
  3. Agree
    VaultV3 reacted to Oozekip in C++ Linked Lists Etiquette Question   
    Having more than one piece of data per node isn't bad practice, and it would help with organization if you keep them together. 
  4. Like
    VaultV3 reacted to Clyne in Should I buy a new Cpu Cooler, and which one?   
    Who told you that? 
    As long it stays below 65C then it's fine. 
  5. Like
    VaultV3 reacted to jnmbhj in Should I buy a new Cpu Cooler, and which one?   
    Stay under 65. But if you want to oc then you will need a better cooler
  6. Like
    VaultV3 reacted to sapphirethunder in Should I buy a new Cpu Cooler, and which one?   
    If you really want better cooling still, you could look for some possible options like Noctua's or BeQuiet.
    But as long as you stay under 65, it's good. I myself prefer under 50 if only possible.
  7. Like
    VaultV3 reacted to Ciccioo in C++ Substring for Integers or setting max width for Integers?   
    if you want to extract the last two digits of a number, you can just work on the integer using modulo
    2014 % 100 = 14
     
    this way the user can enter the year in whatever format, because
    2014 % 100 = 14
    14 % 100 = 14
  8. Like
    VaultV3 reacted to Captain_Slow in New PC build that won't break my funds.   
    LOL
     
    i didnt tell people to pirate nothing
     
    just asking them to look at alternatives.
  9. Like
    VaultV3 reacted to ShadowCaptain in New PC build that won't break my funds.   
    Just sounded like it, there are not really any alternatives when gaming is concerned, its pretty much buy windows, suffer with limited support on linux or do things that are illegal/questionably legal
  10. Like
    VaultV3 reacted to Captain_Slow in New PC build that won't break my funds.   
    PCPartPicker part list: http://pcpartpicker.com/p/C4drpg
    Price breakdown by merchant: http://pcpartpicker.com/p/C4drpg/by_merchant/
    CPU: AMD FX-6300 3.5GHz 6-Core Processor  ($106.02 @ Amazon)
    CPU Cooler: Cooler Master RR-HT2-28PK-R1 54.8 CFM Sleeve Bearing CPU Cooler  ($16.99 @ Amazon)
    Motherboard: ASRock 970 Extreme3 R2.0 ATX AM3+ Motherboard  ($59.99 @ Newegg)
    Memory: Crucial Ballistix Sport 8GB (2 x 4GB) DDR3-1600 Memory  ($74.99 @ Newegg)
    Storage: Western Digital Caviar Blue 1TB 3.5" 7200RPM Internal Hard Drive  ($56.98 @ OutletPC)
    Video Card: Gigabyte Radeon R9 290 4GB WINDFORCE Video Card  ($373.98 @ Newegg)
    Case: Fractal Design FD-CA-CORE-3300-BL ATX Mid Tower Case  ($44.99 @ Amazon)
    Power Supply: Thermaltake SMART 750W 80+ Bronze Certified ATX Power Supply  ($49.99 @ Newegg)
    Total: $783.93
    Prices include shipping, taxes, and discounts when available
    Generated by PCPartPicker 2014-09-12 09:33 EDT-0400
     
    Now if only you can find some other way to get windows....
  11. Like
    VaultV3 reacted to ThatSweetGamer in New PC build that won't break my funds.   
    PCPartPicker part list: http://pcpartpicker.com/p/cxcRnQ
    Price breakdown by merchant: http://pcpartpicker.com/p/cxcRnQ/by_merchant/

    CPU: AMD FX-8320 3.5GHz 8-Core Processor  ($139.99 @ Amazon)
    CPU Cooler: Cooler Master Hyper 212 EVO 82.9 CFM Sleeve Bearing CPU Cooler  ($28.66 @ Amazon)
    Motherboard: Asus M5A99FX PRO R2.0 ATX AM3+ Motherboard  ($114.99 @ Newegg)
    Memory: Kingston Fury Black Series 8GB (2 x 4GB) DDR3-1600 Memory  ($76.99 @ Amazon)
    Storage: Western Digital Caviar Blue 1TB 3.5" 7200RPM Internal Hard Drive  ($56.98 @ OutletPC)
    Video Card: MSI Radeon R9 270X 2GB Video Card  ($169.99 @ Newegg)
    Case: NZXT Source 210 (White) ATX Mid Tower Case  ($33.20 @ Amazon)
    Power Supply: Corsair Builder 500W 80+ Bronze Certified ATX Power Supply  ($49.99 @ Amazon)
    Optical Drive: Asus DRW-24B1ST/BLK/B/AS DVD/CD Writer  ($16.98 @ OutletPC)
    Operating System: Microsoft Windows 8.1 (OEM) (64-bit)  ($87.98 @ OutletPC)
    Wireless Network Adapter: TP-Link TL-WDN3800 802.11a/b/g/n PCI-Express x1 Wi-Fi Adapter  ($31.51 @ B&H)
    Total: $807.26
    Prices include shipping, taxes, and discounts when available
    Generated by PCPartPicker 2014-09-12 09:30 EDT-0400
×