Jump to content

JD85

Member
  • Posts

    21
  • Joined

  • Last visited

Awards

This user doesn't have any awards

Profile Information

  • Gender
    Not Telling

System

  • CPU
    FX 8320 @4.5Ghz
  • Motherboard
    Gigabyte 970A-D3P
  • RAM
    8GB G.SKILL Ripjaws DDR3 1800Mhz
  • GPU
    MSI Gaming Edition R9 280x
  • Case
    NZXT H230
  • Storage
    WD Black 1TB
  • PSU
    Corsiar CX600
  • Display(s)
    ASUS VN248
  • Cooling
    Corsiar H60
  1. I put that at the start of my code and I got the same error after compiling and running. My IDE says that #define __STDC_WANT_LIB_EXT1__ 1 was not used.
  2. I am doing an assignment for college and one of the questions involves concatenating to format a name as "Last, First." I know in C++ you can concatenate using + operator, but our professor wants us to use strcat_s(). This is code that singles out my problem: #include <iostream> #include <cstring> int main() { char firstName[20] = "John"; char lastName[20] = "Smith"; char fullName[40]; std::cout << "First Name: " << firstName << std::endl; std::cout << "LastName: " << lastName << std::endl; strcat_s(fullName, lastName); strcat_s(fullName, ", "); strcat_s(fullName, firstName); std::cout << fullName << std::endl; return 0; } When I compile and run this code I get the following errors: ‘strcat_s’ was not declared in this scope strcat_s(fullName, lastName); ^ If I use strcat() which is an older way to concatenate, everything compiles and runs fine. I did some research and found out that Microsoft made the function strcat_s(), so I was wondering if maybe it only works on Visual Studio in Windows, but I also found that it was a part of C++ 11. I am currently running Linux Mint and CLion, and compiling in C++ 17. Does anyone know the reason I am getting these errors?
  3. Thanks. I didn't even realize that I was using an older version. I'll be sure to update!
  4. Thanks a bunch for the help tjater. I made that change and it worked fine. I looked up that function. It converts the string object to a C style string which is just an array of characters. Apparently .open() doesn't accept string objects. BTW You need to quote people for them to get a notification @JD85 Thank you MrDrWho13. I don't know how the notification system works.
  5. That was an error left behind from my troubleshooting. My bad. I made the change to declare the strings like string f1, f2; I included <stdlib.h> Now I get these errors: T.cpp: In function ‘int main()’: T.cpp:17:13: error: no matching function for call to ‘std::basic_ifstream<char>::open(std::__cxx11::string&)’ fin.open(f1); ^ In file included from T.cpp:4:0: /usr/include/c++/5/fstream:595:7: note: candidate: void std::basic_ifstream<_CharT, _Traits>::open(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::_Ios_Openmode] open(const char* __s, ios_base::openmode __mode = ios_base::in) ^ /usr/include/c++/5/fstream:595:7: note: no known conversion for argument 1 from ‘std::__cxx11::string {aka std::__cxx11::basic_string<char>}’ to ‘const char*’ T.cpp:25:14: error: no matching function for call to ‘std::basic_ofstream<char>::open(std::__cxx11::string&)’ fout.open(f2); ^ In file included from T.cpp:4:0: /usr/include/c++/5/fstream:799:7: note: candidate: void std::basic_ofstream<_CharT, _Traits>::open(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::_Ios_Openmode] open(const char* __s, ^ /usr/include/c++/5/fstream:799:7: note: no known conversion for argument 1 from ‘std::__cxx11::string {aka std::__cxx11::basic_string<char>}’ to ‘const char*’
  6. I am a CS student. In class we are learning how to read and write to files in C++. The slide had a program written that was supposed to do the following: Ask the user to enter the input file. Ask the user to enter the output file. Move the number from the input file to the output file. This was the program: #include <iostream> #include <fstream> #include <string> #include <cctype> using namespace std; int main() { ifstream fin; ofstream fout; string = f1, f2; cout << "Enter the input file name: "; getline(cin, f1); fin.open(f1); if(fin.fail()) { cout << "Failed to open file."; exit(1); } cout << "Enter the input file name: "; getline(cin, f2); fout.open(f2); if(fout.fail()) { cout << "Failed to open file."; exit(1); } int num; fin >> num; fout << num; fin.close(); fout.close(); return 0; } When I compile this code I get the following errors: T.cpp: In function ‘int main()’: T.cpp:13:9: error: expected unqualified-id before ‘=’ token string = f1, f2; ^ T.cpp:15:15: error: ‘f1’ was not declared in this scope getline(cin, f1); ^ T.cpp:20:9: error: ‘exit’ was not declared in this scope exit(1); ^ T.cpp:23:15: error: ‘f2’ was not declared in this scope getline(cin, f2); ^ T.cpp:28:9: error: ‘exit’ was not declared in this scope exit(1); I was able to fix the exit(); errors by including <stdlib.h>, but the other errors remain. Does anyone know what is wrong with this program?
  7. What equipment do I need? I want a turntable I want stereo bookshelf speakers I want to be able to listen to records through the speakers or my Sennheizer HD 598 Cs It would also be nice if I could hook my computer up to the speakers. I would like to stay bellow $300 for the bookshelf speakers, turntable, and receive or whatever you all recommend to get instead. I am really new to audio equipment so I am confused with preamps, dacs, passive vs. powered speakers etc... Thanks in advance for the help!
  8. Rig Name Pluto Specs AMD FX 8320 AMD R9 280x 8GB 1866MHz DDR3 RAM
  9. Disk storage isn't improving much anymore. I would really like some of this new solid state magic so that I can show my friends the wonders of SSDs. Pretty please?
  10. The computer is fine now after a few minutes inside, so I wouldn't say anything was killed with condensation.
  11. My friend and I had and I had an idea to test my computer's temperatures inside(75°F) vs outside(7°F). We did the inside experiment first. 10 minutes of Prime95 was our CPU tester. 3D mark was our GPU tester. All was fine and as expected. Then we took it out onto my porch. Here is where it got interesting. We booted up, started up our monitoring software, and hello 76°C. It lasted like 5 more seconds after that. Then it powered itself off. I would have to guess that the water in my Corsair H60 froze and wasn't circulating to the CPU. I wanted to go out to test again, but I only have this one computer... What do you all think of this. Was it my water cooling that froze?
  12. I got my video submitted at 11:56 last night. It was so much fun. Here is my entry! https://youtu.be/ISrOSCzho1Q
  13. There are the people that want to download more RAM. Also it's fun when everyone who sees my pebble calls it the iwatch. I was trying to help fix my girlfriend's computer and I told her to go to the desktop. She just giggled and asked what it was...
  14. I know the larger cooler cpus will always be faster and as a gamer/website developer I will be in the small percent still rocking a desktop.
×