Search

Find something wrong?


Uh oh. If you’re visiting this page, you may have found something wrong with the site.

That’s okay. Let us know and we’ll try to fix it!

  • If you found something wrong with a particular tutorial of the site (e.g. a typo or incorrect example), just leave a comment on that tutorial.
  • If you found something wrong with the site in general (e.g. broken functionality, the layout), please leave a comment below.
  • If all else fails, use the contact form in the About/Contact section.

Thanks for helping to make the site better for everyone.

91 comments to Find something wrong?

  • jenifer

    Hello Alex,
       It will be helpful for me if you cover the topic "union" also.

    • Alex

      It’s on my to-do list, but given that unions aren’t used very often (I don’t think I’ve ever used one) it’s not very high on that list.

  • Mark Scott

    I was looking to program a loop which writes out the decimal numbers from 0 to 255 with their binary and hexadecimal equivalents and came up with the following:

    When I built the application, vc++ 2017 came back with:

    1>---- Build started: Project: ConsoleApplication1, Configuration: Debug Win32 ----
    1>ConsoleApplication1.cpp
    1>c:\users\marks\documents\visual studio 2017\projects\consoleapplication1\consoleapplication1\consoleapplication1.cpp(12): error C2065: ‘number’: undeclared identifier
    1>c:\users\marks\documents\visual studio 2017\projects\consoleapplication1\consoleapplication1\consoleapplication1.cpp(13): error C2065: ‘number’: undeclared identifier
    1>c:\users\marks\documents\visual studio 2017\projects\consoleapplication1\consoleapplication1\consoleapplication1.cpp(15): error C2065: ‘number’: undeclared identifier
    1>Done building project "ConsoleApplication1.vcxproj" -- FAILED.
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    I cannot see what I have done wrong?

  • Keith Huckshold

    I have been struggling with Problem 4 from the Chapter 2 Comprehensive Quiz.
    My code halts at the "std::cout << "Enter the height of the tower in meters: ";" when attempting to get the initial height input.  The error indicated is that "initialHeight = (double) 0".  I have tried skipping the operator input and doing a direct initialization of "initialHeight" but it remains unchanged at 0.  I cut and pasted your code from the Problem Answer and got identical results!
       I am using Version 8.2.1 of Xcode as my development environment.
       Any suggestions?

    • Alex

      It sounds like the program is just waiting for you to input an initial height into the console window so it can continue to execute.

      • Keith Huckshold

        The program does not execute the std::cout command which is the first statement in getInitialHeight.  There is no prompt on the screen.

        The "initialHeight = (double) 0" message is preceded by a box with a capital L in it and the console output shows only (11db).

        • Alex

          I’m not sure what to tell you on this one. I have no idea why you would be getting that message or why the console output would show (11db). It’s almost like you’re running a different program.

          • Keith Huckshold

            Alex:

            I scraped the project but saved the code.  I started a new Project, inserted the code, with no changes, and it worked.  Apparently I made some unlikely mistake while constructing the first version of the Project that caused it to classify initialHeight as a constant with value 0.  Let’s just put this one down as a CND.  Thanks for your help.

  • Vinn

    Hi,

    The tutorial is awesome and very useful.
    I request you to come up with a tutorial on multithreading and IPC programming in C/C++.

    This will prove very helpful for job seekers and freshers.

    Thank you

    • Alex

      It’s on my to-do list, but I doubt I’ll get to it soon. Thanks for letting me know it’s important though, that helps me prioritize my time.

  • 大家好

    你好,谢谢你的教程,请问能否增加多语言,比如汉语,有很多复杂的英语我看不懂,无法理解一个句子的意义。
    ///
    Hello, thank you for your tutorial. Can you increase the number of languages, such as Chinese, there are many complex English I can not understand, can not understand the meaning of a sentence.

    • Alex

      Hi. Unfortunately, I don’t speak Chinese. Branching out into other languages is something I’d like to explore again, but right now the site doesn’t have the infrastructure for doing the initial translations and (more difficultly) keeping them up to date as the English articles get updates based on reader feedback.

  • MHA

    http://www.learncpp.com/cpp-tutorial/3-8a-bit-flags-and-bit-masks/
    on this page in example of "An introduction to std::bitset" you had set options wrong which option6 should be 5th bit not number 5 means 0101
    thanks for your good site.

  • Satwant

    Hi Alex,
      i have a problem with my visual studio. while typing a line (like any code line Eg. std::cout<<"Please press 5 for xxx function n";) ,if i move the cursor back towards left to add anything new it starts deleting code ahead of it, so i have to retype everything.
    Eg: in above code
    std::cout<<"Please press 5 for and 6 forion n";

      So i have to delete and retype everything. Earlier it was working fine. How can i bring it back to earlier style of typing ,Please help,
                          Thank You.

    • Alex

      I’ve never heard of such a thing. Maybe try resetting your key bindings, or do a Google search to see if anybody else has found a solution.

    • Luke

      I guess you solved this problem by now, but if anyone else has the same problem, all he has to do is to press the "Insert" button on the keyboard when he is in the editor.

  • Gavriel

    Hi,

    First of all, great site!!

    A little annoying thing.
    In the end of each lesson, when you press "Index"
    It goes always back and up to "Chapter0".

    URL: http://www.learncpp.com/#Chapter0

    Just fix that is will go back to the current chapter.

  • John Cooper

    Couldn’t find Code::Blocks with MinGW bundled, but was able to download it separately and install it. Works fine now, thanks.

  • John Cooper

    OK, now I’m pissed. Tried to install  Visual Studio Community 2015. It says I need an update called  KB 2919355. I try to install this upgrade and Windows Update says this update is not applicable (I am using Windows 8.1) WTF?

  • John Cooper

    I am using Code:blocks. I get the error message

    Probably the toolchain path within the compiler options is not setup correctly?! (Do you have a compiler installed?)
    Goto "Settings->Compiler…->Global compiler settings->GNU GCC Compiler->Toolchain executables" and fix the compiler’s setup.
    Skipping…

    I thought the IDE had a compiler. Does it?

  • Ok, I understand. Thanks for your quick answer!

  • Hi Alex,

    I want to thanks you for the excellent web site you did. For sure, I will read all your chapters. I have a question about the comments on your web site. Is it possible to be notified when a new comment appear on your web site?

    Kind Regards,
    Jocelyn

    • Alex

      Thanks for visiting! There is no sitewide comment notifier (in part because there are no accounts, and in part because sending that many emails would cause the site to explode). However, if you leave a comment and someone responds to your comment, you will get an email notification of that specifically (assuming you left a valid email address).

  • Nils

    Hi, i downloaded the pdf-tutorial a few weeks ago.the example code on page 143(binary files) works, but my compiler tells me "unable to open file" instead of "the complete file content is in memory" which is implied and explained after this example…
    #include <iostream>
    #include <fstream>
    using namespace std;
    ifstream::pos_type size;
    char * memblock;
    int main () {
    ifstream file ("example.bin",
    ios::in|ios::binary|ios::ate);
    if (file.is_open())
    {
    size = file.tellg();
    memblock = new char [size];
    file.seekg (0, ios::beg);
    file.read (memblock, size);
    file.close();
    cout << "the complete file content is in memory";
    delete[] memblock;
    }
    else cout << "Unable to open file";
    return 0;
    }

    this is an exact copy of the example in the pdf…
    ty in advance :))

    • Alex

      Hi. I don’t know what PDF you actually downloaded, but that example doesn’t exist on this site. It sounds like maybe example.bin is in the wrong directory though.

  • Chaitanya

    The comprehensive quiz seems to be available for only 9 chapters. It would be great help if quizzes were available for the other chapters too. Thanks!!!

    PS: I love the content and the writing style!

  • Jack

    The site seems to be going down everyday around 8:30am UTC, and continues to suffer from availability issues for a bit afterwards

    • Alex

      Yup, I noticed the site was super sluggish this morning. I made a few changes today that should help with performance, including cleaning a bunch of cruft out of the database that was slowing down queries, changing some file cache settings, and added an additional layer of database caching.

      The site appears to be running faster now -- hopefully that will resolve the issue sufficiently for the time being. If not, let me know and I’ll see if I can figure out what’s happening at that specific time to cause the site to have issues.

  • Heesoo Yang

    It works! Thanks 🙂

  • jo

    Hey there,

    I wanted to leave a comment on part 7.11, but it allwys says that my answer to the security question ist wrong. The question (although i reloaded the page a few times) was always: "one + 3" my answer: "4" is considered as wrong, so I guess there is some functional issue. Anyway, awesome page! Thanks for the effort.

    Btw. I unsubscribed my email by accident, hope this is automaticaly undone by this comment otherwise I would be glad to be subscribed back in!

    /edit1: I tried a few times more, and after a while I got a new question, now the answer was considered to be right, but the comment does not appear. Trying again says: “Double comment detected”

    /edit2: I just got an email to get me back in that email system, so do not worry about that anymore.

  • Alez

    On this page http://www.learncpp.com/cpp-tutorial/28-literals/  there is a small mistake. It says
    "Literal constants (usually just called “literals”) are literal numbers inserted into the code. They are constants because you can’t change their values. For example:"
    and the next line is

    . And that can be changed quite easily just by typing

    . Maybe this just a typo or something (or my lack of understanding English well enough).

    • Alex

      You’re misunderstanding the intent. The boolean values true and false are treated as literals. The fact that they are being to initialize a variable is inconsequential to the point of the example (it is just provided for context).

  • Ben T

    For some reason this site is very very very slow to scroll up and down (with mouse and/or arrow-buttons). It might be shockwave since this plug-in has failed for me on this site in the past (not that I know anything about this stuff!). I am using the latest version of Chrome (Version 52.0.2743.82 m).

    Otherwise, the content is great. I can’t wait to finish it all! But I’m currently on the Chapter 6 quiz, and the scrolling issue is becoming very frustrating!

    Hoping this comment is helpful… Any advice or recommendations will be very much appreciated.

    Thanks!

    • Alex

      I’ve seen that happen when the Flash/Shockwave plugin is bugged. When it happens to me, I can usually fix it by killing the process in the task manager (it’s usually eating up all the memory).

  • Kattencrack Kledge

    There are two odd rectangles (one on the left and one the right of any page) that are just there, empty.
    When I load a page, for a split millisecond, these two rectangles take the whole length of the page, then suddenly collapse back into a small rectangle.

    I’m talking about these rectangles: http://imgur.com/8pkUTql

    Ohh and btw, as I’m writing this, I was trying to “accidently” click an ad, but your ads aren’t showing up anymore (pops up for a millisecond, then dissapears) (so these rectangles were probably the ads to the right and to the left) (you’re probably tweeking some stuff right now?)

    • Alex

      That’s where the ad blocks go.

      There are two reasons they might not appear:
      1) Your browser, a browser plugin, or some other network filter are blocking them.
      2) You clicked on them too many times, or someone sharing an IP address did. The ads will disappear after a certain number of clicks to prevent click abuse.

  • Xanti

    Ok, I don’t know why, but for some reason I keep getting an error about a script that is busy or has stopped responding whenever I start looking at this site, other than this page. I started looking at the tutorials and saved my page (1.1 Structure of A Program) and left to go out. I came back and started where I left off. After I got to the next page on Comments, it started happening. After having to end task on my web browser about 3-4 times (FireFox, most recent version, I believe) I was able to get to the next page. I’m leaving this comment after having to end task it about 6 more times just trying to read less than half the next page (1.3 Variables, Initialization and Assignment).

    • Alex

      It’s possible the site was having issues. If you’re still experiencing problems, try using a different web browser (I suggest Chrome) and see if the problem persists.

  • Tristan Gybels

    This code in chapter 1.4 doesn’t work, even if I delete the last comment.
    The error is to long to describe in my mail, it will spam your site 😛

    BTW; I love your site, it helps me getting prepared for my studies next year.

    Regards, Tristan

  • Petros

    Congratulations for all the great job that you have done here. Your site has the most comprehensible tutorials. I was wondering though if you could also write about C++11 features such as smart pointers (I think they are Boost-derived), or the new way of initializing a variable etc. Especially smart pointers is a huge leap forward in terms of safety, better memory managent and cleaner, bug-free code.

    Keeping track of new standards could be a very good way for us to be up to date and informed about new and exciting capabilites of C++.

    Once again, well done for the hard work.

    • Alex

      Thanks for the feedback. Yes, I have smart pointers on my list of things to write content about.

      I just don’t have much time to write these days, so progress is slower than I’d like.

  • Sagar Sanghavi

    I see following line during the explanation of all macros:
    va_start() takes two parameters: the va_list itself, and the name of the last non-ellipsis parameter in the function.

    Isnt this wrong? I mean isnt the 2nd parameter to va_start() supposed to be the number of arguments instead of "name" of last parameter as mentioned in the explanation?

    • Alex

      No, it’s supposed to be the name of the last non-ellipsis parameter in the function. In many cases, this is a count variable, since many functions that use ellipses have a count parameter and an ellipsis as the only parameters.

  • David

    Hi Alex,
    your tutorial is really great! It doesn’t only teach c++, but also general programming best-practises (e.g. comments etc.) and even though it’s beginner level, it’s not boring to me (programming in Java at hobby-level for four years). I love it!
    But there’s an issue with your web site: I am using two separate screens, one in landscape and one in portrait orientation. On the regular (landscape) monitor, everything is fine. But on the rotated monitor, the actual content part is very narrow. That makes it really hard to read (I guess the margins at the sides are fixed width, so they take up almost all the space).
    Would be great if you could fix this so the content takes up the entire width on narrow monitors!

  • Alex

    I turned my ad-blocker off since I have nothing against supporting free websites that use ads to maintain the server. However, I have unfortunately had to turn it back on due to unresponsive scripts killing Firefox. Not sure if anyone else has had this problem but it occurs for me every 5-10 minutes. If you can figure out what’s causing this I’ll happily turn my ad-blocker off again for this site.

  • Ujjwal Jain

    hi,
    I am a Big Fan of your Website.thank you very much for making wonderful website with amazing  content .

    but now i am facing issue with website layout . u have added new layout in right site of website admin login dialog.when i try to minimize the browser and dock it in right or left side of screen because of admin dialog middle part or content part of ur website become very less width so we can’t read properly .so my suggestion is put admin dialog also to left side so website content we can easily read while doing minimize.

    Thank you very much

  • Matt

    1) In the section of code on friend member functions in the section on how the Display / Storage code does not work correctly you have:

    Would it be correct to say that the error occurs because Storage hasn’t seen the full "definition" of class Display and not "declaration" or are they the same thing?

    2) In the section of code on friend member functions I believe your example of how to code Display / Storage correctly has an error in it:

    3) Perhaps I misunderstand but in the quiz section you ask us to:
    "1a) Make Vector3d a friend class of Point3d, and implement function Point3d::moveByVector()"
    However, the solution seems to be to make Point3d a friend of Vectory3d and implement void moveByVector().

    • Alex

      1) Declaration. The compiler only needs to see the declaration of class Display, not the definition. The declaration is just the forward prototypes of everything. The definition would include the function bodies, which aren’t needed for this.
      2) Fixed.
      3) Also fixed. Thanks!

  • Bill

    Search seems broken (Google Search API has changed?):

    Requests without cx/cref are no longer supported That’s all we know.

  • sohan

    whenever i try to open this site with my iphone i get redirected to some tradeechange.com. i think you must clean your website but still i love this….

    • kevin

      that is probably a problem with your iphone. to fix this try clearing all history and website data.

      Settings -> Scroll Down To Safari -> Scroll Down to Clear All History and Website Data.

    • Alex

      Things work fine on my iphone. I’d suggest trying a different browser on your iphone and see if maybe your iphone’s browser has been hijacked.

  • kevin

    in 2.5 in this block of code

    the first comment is orange while all the other comments are green.

  • yash

    Hi Alex,
    The font in my browser (Google Chrome) has become small. How to adjust it.

  • kevin

    in 1.4a on quiz question one. there are actually two things wrong with code.

    the mutliply is indeed void but for the cout it doesnt call std.
    it also isnt "namespaced"

    btw love the site, keep up the work!

    EDIT: i just saw it says fragment.

  • Damian

    Hello, In your tutorial 1.9 Header files your tutorial on creating add.h file would not run on my devC++ after an hour of adding file to project deleting file, re-adding it, re-writing it reading through the comments trying to find the error "initializer set before main0." i tried putting #include <iostream> before #ifndef ADD_H and the programme ran without hitch. It was such a silly mistake i thought you may add this line of code to your tutorial just so fools like me won’t fall into this trap.

    p.s. thank you Alex for your time and tutorial it is the easiest i have found to follow.

    • Alex

      #ifndef ADD_H should be the first line in the header. If you had to put #include <iostream> before that in order to get your program to work, something else is going on. Drop me a line using the comment form and we’ll see if we can figure out what’s going on.

  • Alex, there is problem with your site when surfing with 2G network. Almost every time when I try to load a page on this site with 2G, browser only downloads the half of the page. So if I have to post a comment, I can’t because comment box is in the bottom(Using 3G now). I also miss the useful comments. All the posts have 30 comments (an average) and missing them all is a big loss. I found the same problem with other sites using the same theme (I guess, it’s Tiga). Over 43% of Indian net users have to use 2G because 3G or 4G is not available everywhere(or because these are expensive). So here is a suggestion, use another theme (I know that would take some engineering behind the pages). I suggest you to use sparkling (demo: https://colorlib.com/sparkling/) because of its simplicity. It is free, responsive and most importantly, beautiful. I tested it with other devices and found it is really responsive). I thought I should tell about this to you. Otherwise, the contents of the site are awesome.

    • Alex

      There shouldn’t be any difference in rendering the page with 2G and 3G. I haven’t used Tiga for a long time. Does the rendering stop at a consistent place each time, or somewhere different? Maybe something is timing out with 2G.

      • Avneet

        No it doesn’t stops in the same place. Browser loads the page sequentially (from top to bottom) and because pages are long, it requires many things to load at a request. I don’t know exactly why this happens But sure, this is not a timeout problem (coz  there is no warning/error message). And trust me, almost everytime I try to download(browse) the page with 2G, suddenly it stops loading. I tried reloading with chrome, firefox and explorer.

  • Maxime

    Hi,
    First of all, thanks for your site!
    A small error I found in the quizz of chapter 3 :
    the solution of 2b is : "b) 14 % 5 = 2 remainder 4, so this equals 4."
    I think it should be "14 / 5 = 2…." (replace the modulus)

    ++

  • Hey Alex, this is Avneet here. Yes, again. I was wondering why admin login link is visible to users(like me). This is totally useless for innocent learners and highly profitable for hackers. I think, you should hide it from us(visitors).

    [ Rest of post redacted for security -Alex ]

    • Alex

      Hi Avneet. I appreciate both your concern and the tips. The login link is solely for my own use, and you’re right, it could be easily hidden. I’ll look into it.

      • Editing internal filenames (wp-config, wp-login etc.) may result errors. Because the default wp login page is accessible without any explicit help, I would suggest you to change the path (URL) of wp-login.php but in a way that is safe to use. There are articles explaining how to change default login page url for WordPress. BTW…I am a fan of you and your site. plz don’t ever remove this from web.

        • Alex

          Yup, I’m aware of the challenges (I’ve looked into moving the login page before, but at the time there was no safe way to do it). It seems like that may have changed. I’ll do some research (when time permits) and test on my test site before rolling out here. 🙂

  • Hello Alex. My regular comments may irritate you but I won’t stop because I love your tutorials and the way you answer to my questions. You are reallyyyyyy great. Many thanks to you for giving us such platform to learn C++.
    This comment is for informing you about  a bug (may be not) in this website. Captcha is a required field when posting a comment but no asterisk is there to mark this field as required. So, a new user when attempts first time to comment, he may leave captcha unanswered.  Mark this fied as required if you feel that it’s important,  otherwise ignore my comment. Leaving captcha field empty will definitely give an error and next time user will know that answering captcha is needed to post comment.

    • Alex

      The captcha is provided by a 3rd party plugin. Doing this would require modifying the plugin. Then, on the next update of the plugin, my modifications will get overwritten.

      I think this is something user will have to live with for now. 🙁

  • cpplx

    rearange botcheck for comments next to post button.

  • cpplx

    i am having hard time reading code using "convention" naming. i have 2 suggestions. either put a refference table of "convention" stuff or rename or redo ALL to more sensible names. im having hard time to figure out what is a keyword and what is a "convention" name. (nArraySize; szName; pnPtr…)

    • Alex

      I am in the process of rewriting all of the articles, and am updating the naming conventions as I go.

      The only naming conventions I recommend now are the following prefixes:
      g_ for global variables
      s_ for static variables
      m_ for member variables

  • cpplx

    about the site layout…
    the main text body is taking about the half of my 10" screen (1024×600).
    it would be much better if it takes most of it.
    side stuff does not go all the way so it can be rearranged on top and leave the whole width for reading.
    the site is about reading after all

  • Alkis

    Hi Alex,
    You have a little error in your table in 3.1 - Operator precedence and associativity.
    The conditional operator has right associativity.
    Thanks for the great site!

  • Pisces72

    Hello. I’m enjoying your tutorials. They are very well written and explained!

    One suggestion: you could include the navigation buttons on top of each article as well as bottom to allow easier reading and "turning" pages.

    Thanks!

  • john

    when i tried the hello world i got an error i dont know what this means and what to do i put in the info like it said /

    // HelloWorld.cpp : Defines the entry point for the console application.
    //
    #include "stdafx.h"

    #include <iostream>

    int main()
    {
        std::cout << "Hello world!" << std::endl;
        return 0;
    }

    but it didnt work this is what i got when i pressed f7/

    1>---- Build started: Project: HelloWorld, Configuration: Debug Win32 ----
    1>  HelloWorld.cpp
    1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    so why didnt it work is ther somethging wrong with my system why cant i use this program ???

Leave a Comment

Put C++ code inside [code][/code] tags to use the syntax highlighter