Anonymous
where do i put that
Alim
Cars(int cYear, string cMake , int cSpeed)
Anonymous
is that the regular constructor?
Alim
regular constructor
Anonymous
ok where do i put the regular and default
Alim
like method
Anonymous
like method?
Anonymous
what does that mean?
Anonymous
where is the default
Anonymous
thats the finished code?
Alim
#include "stdafx.h" #include <iostream> #include <iomanip> #include <string> using namespace std; class Cars { private: int year; string make; int speed; public: Cars() = default; // default constructor Cars() // default constructor { //.... // code //.... } Cars(int cYear, string cMake , int cSpeed) // regular constructor { year = cYear; make = cMake; speed = cSpeed; } void setYear(int y) { year = y; } int getYear() { return year; } void setMake(string m) { make = m; } string getMake() { return make; } void setSpeed(int s) { speed = s; } int getSpeed() { return speed; } }; int main() { return 0; }
Anonymous
how do i know if its right or not
Anonymous
wait what?!
Anonymous
why does the default constructor have to have code in it if its default?
Alim
default constructor has not parametrs
Anonymous
so where it says // code // i put nothing?
Alim
Cars(){} - also default constructor
Anonymous
theres two default constructors?
Anonymous
http://prntscr.com/jzbpi8
Anonymous
why did you put two?
Alim
theres two default constructors?
yes , but this for exapample
Anonymous
whats for example?
Anonymous
i want the final code not the example because now youre confusing me
Anonymous
which one is right?!
Alim
delete second default constructor
Anonymous
ok
Anonymous
i ran it and it didnt work
Anonymous
// ConsoleApplication15.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> #include <iomanip> #include <string> using namespace std; class Cars { private: int year; string make; int speed; public: Cars() = default; Cars(int cYear, string cMake, int cSpeed) { year = cYear; make = cMake; speed = cSpeed; } void setYear(int y) { year = y; } int getYear() { return year; } void setMake(string m) { make = m; } string getMake() { return make; } void setSpeed(int s) { speed = s; } int getSpeed() { return speed; } }; int main() { return 0; }
Anonymous
it said "press any key to enter"
Alim
int main() { return 0; } cin » cout « ??
Anonymous
what?
Anonymous
oh my god you are confusing me what the heck
Anonymous
never mind holy fucking shit
Alim
int main() { return 0; } nothing here
Anonymous
Hello world :P pun intended I recently started to learn to code, i started with C++ on visual studio 2017 But i read and decided to start learning C first, to get a better grasp on programming So i was adviced to start with a book called computer systems: a programmer's perspective 3rd edition
Anonymous
Please help and if anyone has the book it be much appreciated
Stanislav
and for C you can't use VC++ :/ it's non comformant to C
Anonymous
They told me that c helps with getting better grasp of the Procedural aspect of coding
Anonymous
Like what will the computer do with the code
Anonymous
who?
Lool the internet
Stanislav
Like what will the computer do with the code
you can do that almost can c do in C++
Stanislav
and more effective
Stanislav
see constexpr...
Anonymous
you can do that almost can c do in C++
I know they do the same and heck even c++ is better for object oriented
Anonymous
ehuehuehe
Anonymous
https://twitter.com/twitter/statuses/971019559095427075
Stanislav
I know they do the same and heck even c++ is better for object oriented
C++ is multiparadigmic, not only object oriented
Anonymous
I'm totally new and i thought maybe starting with c as the basic is better
Stanislav
you can write in C style, and what you want
Anonymous
C++ is multiparadigmic, not only object oriented
Exactly what is a paradigm Sorry if it's a basic question
Anonymous
The word multiparadigmic alone scares me
Stanislav
Exactly what is a paradigm Sorry if it's a basic question
https://en.wikipedia.org/wiki/Programming_paradigm
Novus
Hello. I have read the pinned massage
Anonymous
Can someone clarify for me, is it considered better practice to include variable names in function prototypes? I've always been told it's bad practice to include them but I've heard from others recently that it's good practice to include them
Anonymous
Hello admin!😁
Anonymous
Can u tell me best book of C/C++ beginners
Anonymous
Hello admin can you tell me that in 3 years a best software engineer can be made
Anonymous
That's a bot
Anonymous
#cpp
Anonymous
books are in that link
M.
C++ Resources: Biased Towards Beginners License: GPL3 Official C++ Homepage: https://isocpp.org ISO C++ committee: https://isocpp.org/std/the-committee Language Improvement Papers: http://www.open-std.org/jtc1/sc22/wg21/docs/papers FAQs http://www.stroustrup.com/bs_faq.html (I actually read this all) http://www.stroustrup.com/bs_faq2.html https://isocpp.org/faq http://www.stroustrup.com/C++11FAQ.html Communities: Reddit (reddit.com) - http://reddit.com/r/cpp - http://reddit.com/r/cpp_questions (U can also ask questions here) Slack: https://cpplang.now.sh/ Discord: https://discord.me/cpp Cpp Reference: http://en.cppreference.com/w/ Books: (contains rare gem) https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list Online Tutorial: http://learncpp.com https://fbb-git.github.io/cppannotations/cppannotations/html/index.html http://www.bogotobogo.com/index.php Pod Cast: http://www.cppcast.com/ Youtube: https://www.youtube.com/user/lefticus1/videos https://www.youtube.com/channel/UCQ-W1KE9EYfdxhL6S4twUNw https://www.youtube.com/channel/UCEOGtxYTB6vo6MQ-WQ9W_nQ Conferences: CppCon: https://cppcon.org/ BoostCon: https://www.youtube.com/user/BoostCon Meeting Cpp: http://meetingcpp.com/ Blogs: https://akrzemi1.wordpress.com/ http://ericniebler.com http://foonathan.net/ https://herbsutter.com/category/c/ https://www.kdab.com/category/blogs/ https://thephd.github.io/ https://blogs.msdn.microsoft.com/vcblog/ Awesome C++ Resource Collections: https://github.com/fffaraz/awesome-cpp https://github.com/rigtorp/awesome-modern-cpp https://github.com/uhub/awesome-cpp — Selected Topics (No particular order) — Modern Cpp Features ( >= C++11): https://github.com/AnthonyCalandra/modern-cpp-features C++17 http://www.bfilipek.com/2017/01/cpp17features.html https://jfbastien.github.io Concurrency & Parallelism: http://www.bogotobogo.com/cplusplus/multithreaded.php http://thispointer.com/c-11-multithreading-part-1-three-different-ways-to-create-threads/ Networking: Networking TS - The proposed standard Networking Library:* Where it all began: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1925.pdf Where we at: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/n4734.pdf Implementations: Typically comes with newer ASIO and Boost::ASIO https://github.com/chriskohlhoff/networking-ts-impl ASIO A cross-platform C++ library for network and low-level I/O programming that provides developers with a consistent asynchronous model using a modern C++ approach. Homepage: http://think-async.com/ Github: https://github.com/chriskohlhoff/asio/ Guides: https://theboostcpplibraries.com https://www.boost.org/doc/libs/1_67_0/doc/html/boost_asio/tutorial.html http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3388.pdf: gives a brief, high-level introduction to how Asio may be used in conjunction with C++11. Other libs: https://github.com/fffaraz/awesome-cpp#networking seastar: For real heavy lifting: https://github.com/scylladb/seastar CppCMS — C++ Web Framework http://cppcms.com Docs http://cppcms.com/wikipp/en/page/cppcms_1x Reference documentation: http://cppcms.com/cppcms_ref/latest/ Pointers: https://web.archive.org/web/20170930150208/http://www.cs.umd.edu/class/sum2003/cmsc311/Notes/BitOp/pointer.html
thank you for this one
Anonymous
Pls.. give me link for kali linux in windows 64 bit....
Anonymous
Pls.. give me link for kali linux in windows 64 bit....
Why are you asking in here? And that doesn't even make sense
Anonymous
Kali Linux is operating system of hacker..
Anonymous
yeah, I'm aware of what Kali is, but asking for a copy of an operating system for a different operating system makes no sense at all
Anonymous
Ohk
correctmaninwrongplace
Can someone clarify for me, is it considered better practice to include variable names in function prototypes? I've always been told it's bad practice to include them but I've heard from others recently that it's good practice to include them
In university i have been told to include it. In my opinion, is good, because if You give Someone the prototype, that person can know which variables needs the function
Max
Can someone clarify for me, is it considered better practice to include variable names in function prototypes? I've always been told it's bad practice to include them but I've heard from others recently that it's good practice to include them
imagine using this: int foo(int, int, int, int, char*, char*, char*, int); vs this: int foo(int year, int month, int day, char *id, char *address, char *parent_id, int priority);
Anonymous
Yeah, that's a very good point
Krithik Kumar
Hi
Krithik Kumar
Guys
Krithik Kumar
Iam studying computer science in btech
Krithik Kumar
I have completed my 1st year