[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
C++ help ( .h and .hpp)
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 11
Thread images: 3
File: CPlusPlus.jpg (36 KB, 433x455) Image search: [Google]
CPlusPlus.jpg
36 KB, 433x455
I trying to make a .hpp file but when I try to compile the compiler is throwing me errors with my constructor.
>>
ok.
>>
File: aids.jpg (514 KB, 1919x1077) Image search: [Google]
aids.jpg
514 KB, 1919x1077
Screen shot:
>>
File: aids.jpg (505 KB, 1915x1075) Image search: [Google]
aids.jpg
505 KB, 1915x1075
second attempt...
>>
>>50788357
.hpp is just a file extension. make sure you changed your includes and makefile.
>>
>>50788369
You are assigning T to data in your default constructor. T however is not a value so you cant assign it. Its only a placeholder for a type.
>>
Tyrone, stealing bikes is easier than compiling code you know ;^)
>>
It looks like you're trying to warn the compiler that "data" is of type T. You don't need to do that, the compiler knows.

Think of "T" as being a literal copy-and-paste.
>>
Programming 268 @KU? Dr. Gibbo?
>>
>>50788357
mate, just pastebin the fucking code and the error message
>>
>>50788380
You should probably read your book.

You don't compile header files (your .h files), change that in your Makefile so its just:
g++ Node.cpp LinkedList.cpp -o test

Your .hpp files should be .cpp files for clarity, although it isn't causing any errors.
You're literally doing everything wrong when it comes to defining the template functions.
Thread replies: 11
Thread images: 3

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.