Jump to content

Avratz

Member
  • Posts

    163
  • Joined

  • Last visited

Awards

This user doesn't have any awards

1 Follower

About Avratz

  • Birthday Jul 15, 1986

Profile Information

  • Gender
    Male
  • Location
    Dallas
  • Occupation
    Programmer
  1. The issue is that you are using cin << for input which is tokenized by spaces. Even if I enter "oshi no ko" it will only read "oshi" as my input (trying echoing your input with cout). The comparison will fail regardless if you use the overloaded == operator or strcmp. You need buffered input https://en.cppreference.com/w/cpp/string/basic_string/getline Pro-tip: don't ever use 'using namespace std'. Just get used to typing std:: #include <iostream> #include <string> int main() { std::string name, anime, yn; std::cout << "Enter your name:" << std::endl; std::getline(std::cin, name); //std::cin >> name; std::cout << name << " is a nice name" << std::endl; std::cout<< "Do you have watched any animes? Reply in yes & No" << std::endl; std::getline(std::cin, yn); //std::cin >> yn; //try commenting out the std::getline and uncommenting the std::cin lines above //and see what happens. //After that uncomment the two lines below and try again //std::cin.clear(); //std::cin.ignore(INT_MAX, '\n'); if (yn=="yes") { std::cout << "Which was your favourite?"; std::getline(std::cin, anime); //when in doubt, echo your input //std::cout << anime << std::endl; if (anime=="oshi no ko") { std::cout << "Thats great!" << std::endl; } if(anime=="hi") { std::cout << "Good evening." << std::endl; } } return 0; }
  2. Output impedance will only be a factor when considering tube amps. Digital amps are generally in the <1ohm range. For example, I own a Schiit Vali. At 6.5ohms it's too noisy for my 38ohm ATH-M50s, but sounds fantastic with my 250ohm DT-990s. According to the Asus site, your onboard sound uses a Texas Instruments LM4562 op-amp. Rated at 0.01ohms output impedance, and can drive 600ohm headphones. You don't need anything else, really. Get the cheaper DT-990s. It's plastic vs metal frame, otherwise identical.
  3. HGST Deskstar NAS. 3TB drives are ~$130 http://arstechnica.com/information-technology/2015/01/hard-disk-reliability-examined-once-more-hgst-rules-seagate-is-alarming/
  4. http://www.cplusplus.com/reference/cstring/strcmp/ You need to use strcmp() to compare strings. Also, when using %s in scanf you should limit it to your buffer size with %Xs where X is your buffer size minus 1. Buffer overflows will cause you headaches. Since your buffer size is 10 you would write: scanf("%9s", lcTipoVehiculo);
  5. A pointer can be passed either by value or by reference by value void foo(int* bar); by reference void foo(int* & bar); Arrays generally decay to a pointer, but not always.
  6. I've had to use it the past 4 months at work porting our software to Chrome Native Client. Its integrated GDB debugging is about the only real redeeming quality for C++ coding. It's serviceable once you spend some time setting it up. That is, turning it into a fancy text editor with integrated debugging. CLion might overtake it, but as it stands there aren't a lot of worthwhile options for C++ IDEs in Linux.
  7. Avratz

    Dimmdrive

    http://www.traynier.com/software/steammover More useful, and free.
  8. That bad boy would speed up my compile times nicely. And, of course, gaming, running virtual machines, video editing. Sometimes all at the same time.
  9. Screw a funnel. I'd just siphon it from the big jug of oil
  10. Take address1 out of quotes in your fopen_s call. You're trying to open a file called "address1", not what you entered. fopen_s(&file_in, address1, "r");
  11. Escaping is only needed for string literals. User input doesn't need to. In your original example, you had the file paths hardcoded, and thus needed to escape them. The *_s functions are done that way, so the function can return a meaningful error value. It's safer in the sense that you are handed the error code directly rather than relying on a global error flag. See the section on return values here http://msdn.microsoft.com/en-us/library/z5hh6ee9.aspx For standard fopen you have to make a call to perror() or check the value of errno to get more information on the error. A NULL file handle isn't very meaningful beyond the fact it failed. Sometimes it's useful to know why. ex Microsoft version
×