Jump to content

infernowheels

Member
  • Posts

    164
  • Joined

  • Last visited

Reputation Activity

  1. Like
    infernowheels reacted to as96 in [HELP]C++ - Functions   
    You are not passing those variables by reference, they are just copies, when you print them you just print un-initialized variables, only arrays get passed automatically via reference for every other type you need to use &
  2. Like
    infernowheels reacted to Mauri in [HELP]C++ - Functions   
    When you pass in a variable to a function, you don't need to declare what type of variable you're passing in because you've already included the variable type in your function name:
    void read( studentType p[] ){ //read function here}  so when you pass in p[] inside your main, you just need to pass in the variable name p
     
    So it would just be 
    #include <iostream>using namespace std;struct studentType{ // //};void read( studentType p[] ) { //read function here}int main(){ studentType p[MAX]; read(p); return 0;}
  3. Like
    infernowheels reacted to JamieF in Need some help with my C++ program   
    You need an int before the main function so int main()
     
    The problem, from what I found, is this if statement:
    if(num == tool[MAX]) num is define earlier as the number of tools which the user has to enter, but the tool array is the tool codes, so 1 for kitchen, 2 for garden and 3 for garden.
    else if(code != tool[MAX]) { cout << "Invalid input." << endl; break; } You can put this as just an else as any other input if it's not 1,2 or 3 will be invalid. You'll need a correction though to make sure they can put in the input again.
     
    The last problem is the if statements.
    if(code == 1) { cout << "Kitchen tool" << endl; kitchen++; } else if(code == 2) { cout << "Gardening tool" << endl; gardening++; } else if(code == 3) { cout << "Machining tool" << endl; machining++; } Remember arrays start at 0 so 0 will be tool code 1, 1 will be tool code 2 and 2 will be tool code 3.
     
    Here's the full code:
    #include<iostream>#define MAX 3using namespace std;int main(){ int tool[MAX] = {1,2,3}; int num, code, kitchen = 0, gardening = 0, machining = 0, x = 0; cout << "How many tools are to be processed?: "; cin >> num; do { cout << "Input tool code: "; cin >> code; x++; if(code == tool[0]) { cout << "Kitchen tool" << endl; kitchen++; } else if(code == tool[1]) { cout << "Gardening tool" << endl; gardening++; } else if(code == tool[2]) { cout << "Machining tool" << endl; machining++; } else { cout << "Invalid input." << endl; cin >> code; } }while(x < num); cout << "The number of Kitchen tool(s) is: " << kitchen << endl; cout << "The number of Gardening tool(s) is: " << gardening << endl; cout << "The number of Machining tool(s) is: " << machining << endl; system("pause");return 0;} Edit: I forgot to mention I changed the value of x to 0 and put while(x <num)
  4. Like
    infernowheels got a reaction from vern021 in Post Linus Memes Here! << -Original thread has returned   
    ...aaand that's how Slick lost his hair.
  5. Like
    infernowheels got a reaction from fringie in Post Linus Memes Here! << -Original thread has returned   
    ...aaand that's how Slick lost his hair.
  6. Like
    infernowheels got a reaction from JoaoPRSousa in Post Linus Memes Here! << -Original thread has returned   
    ...aaand that's how Slick lost his hair.
  7. Like
    infernowheels got a reaction from mynameislemos in Facebook To Buy Oculus Rift For $2 Billion   
    Time to play Farmville in First person mode then...
  8. Like
    infernowheels got a reaction from WinNut in Post Linus Memes Here! << -Original thread has returned   
    ...aaand that's how Slick lost his hair.
  9. Like
    infernowheels got a reaction from flibberdipper in What’s the worst part of your rig?   
    I hate it so much because I don't have one.
  10. Like
  11. Like
    infernowheels got a reaction from TTquicken in Post Linus Memes Here! << -Original thread has returned   
    ...aaand that's how Slick lost his hair.
  12. Like
    infernowheels got a reaction from Glenwing in iPhone 6 To Have Sapphire Glass Screen?   
    From what I've heard, the proposal is that they put a thin layer of Sapphire over Gorilla glass or any standard(strengthened) screen glass, therefore it'll cost less, be less prone to shattering and more scratch resistant. It's a more viable option than just pure Sapphire.
  13. Like
    infernowheels got a reaction from Siggen in Tech Armory's "Gladius" oil cooled PC   
    Whut NO SOUND AT ALL? Only heard keyboard and mouse? TechArmory doesn't have speakers?
  14. Like
  15. Like
    infernowheels got a reaction from 7850OC in AMD Catalyst 13.35 BETA Driver With Mantle and HSA Support   
    I smell AMD awesomeness incoming.
  16. Like
    infernowheels got a reaction from jacobsavona in No Video Output AT ALL   
    Try to reset the CMOS. I just experienced the same problem earlier today. 
  17. Like
    infernowheels got a reaction from KyonCoraeL in System not sending video signal? (I think)   
    Okay, I've got it fixed, seems like resetting the CMOS twice did it. Hmmph
  18. Like
    infernowheels got a reaction from TheSLSAMG in LG G3 leaked, will feature 1440p display   
    Actually, the Odin was able to get those scores only with a max clock of 1 GHz, it's yet to show it's true potential.
    http://www.phonearena.com/news/LGs-octa-core-chip-gets-benchmarked-score-is-consistant-with-a-big.LITTLE-architecture_id50771
  19. Like
    infernowheels reacted to TheRuke in Google's top search result for "iTunes" is a malware website   
    Are you suggesting the real iTunes ISN'T maleware?
  20. Like
    infernowheels reacted to exotioner in Google canary chrome, mistakes in the waiting   
    Google is a great company, but they forget one crucial thing :

    if it isn't broken, don't fix it.

    Youtube was absolutely fine years ago, Youtube started changing, people didn't like it.
    Google started Joining, People are hating on it.

    As I said, 
    If it isn't broken, don't F*cking fix it. :l
  21. Like
    infernowheels reacted to digitalnav in Digital Storm details its first Steam Machine   
    Thanks for the love guys! Currently, the only way to obtain this chassis is to buy a complete system. We may offer cases this upcoming year.
     
    And yes, I've been playing and developing this beast for a couple months now!
  22. Like
    infernowheels reacted to thedigitalmilk in AMD FreeSync - AMD's Free G-SYNC Alternative   
    Instead of calling it "Free-Sync" they should have called it "Hahagof*ckyourselfNvidia-Sync"
  23. Like
  24. Like
    infernowheels reacted to Nineshadow in AMD FreeSync - AMD's Free G-SYNC Alternative   
    WE KNEW THIS WAS COMMING!
    I just named it wrong, R-Sync.Damn.
  25. Like
    infernowheels reacted to Torand in AMD FreeSync - AMD's Free G-SYNC Alternative   
    Full credit for the article goes to AnandTech:
    http://www.anandtech.com/show/7641/amd-demonstrates-freesync-free-gsync-alternative-at-ces-2014
     
     
     
    If they can pull this off, it will be amazing.
     
    The power saving idea on the notebooks is also a great addition and use of the technology, leaving the display in an idle, non refreshing state when there is no update in frames from the GPU. Not to mention, in theory this doesn't have a limit on what panels it can support as its just enabled at the factory (right? i think?).
     
    Looks interesting none the less. Although AMD does not yet have a clear target for market release (time & date) or product names, etc.. But here's to the future!
     
     
     
    EDIT: added information & article extract. Elaborated slightly. 
     
    EDIT 2: Here is the Wiki listing for the VESA VBLANK standard: http://en.wikipedia.org/wiki/Coordinated_Video_Timings
     
    EDIT 3: Please read this thread before commenting [ http://linustechtips.com/main/topic/99660-the-real-difference-between-free-sync-vs-g-sync/ ]. Gives you a better understanding of the technology, this article is just bringing the fact that it exists and basic information. 
×