• 0

Newbie C++ Help


Question

211 answers to this question

Recommended Posts

  • 0

i've got c++ for dummies, too.

it's really good.

I started with visualbasic when i was 12. After that, there was html, blitz basic, php and at last c++. I can recommend the quakenet php tutorial, it is very good.

But one question: What is the command to run an *.exe with c++?

thx, sacred :D

  • 0
Firstly, I would not recommend assembly for a beginner to learn, especially not x86.  Secondly, I would not recommend that book (AoA).  Thirdly, I would not recommend using TASM or MASM.  I've used them both and they both suck.  They're full of red tape.  If I was to choose between the two, I'd go for TASM, but given the choice to choose another, I'd go for NASM.

586134243[/snapback]

I agree!

x86 is major pain and NASM is the way to go. MASM will give you bad habits.

Is Bjarne's book THE book for C++?

I'm trying to start with C++, but there's nothing in my code that makes it C++, it might as well be C.

  • 0

i wan to compile the C++ with visual C++

anybody can teach me ?

i will kindly appreciate it ....

when i wan to create a program, create file then choose C++ source file to program,

then after what should i do ?

when i press ctrl-F7 to compile it, it prompt me to create project workspace....

then only can compile.....

after that when i choose to run another program, can compile but cant run

why ?

  • 0

I found a book called "C++ Programming Language; Special Edition" by Bjarne Stroustrup, 2000.

ISBN: 0201700735

I'm seriously thinking about getting that one.

I'm pretty much a beginner, but I have programmed before but never in C++.

I need a solid ground to stand on.

Anyone have that book or a previous edition?

Or do you recommend another one?

I'm planning on getting this for christmas, my wishlist is really short so my parents will have to buy me all of the things that are there (two things, hehe).

Thanks in advance,

Radium. :)

  • 0
I found a book called "C++ Programming Language; Special Edition" by Bjarne Stroustrup, 2000.

ISBN: 0201700735

I'm seriously thinking about getting that one.

I'm pretty much a beginner, but I have programmed before but never in C++.

I need a solid ground to stand on.

Anyone have that book or a previous edition?

Or do you recommend another one?

I'm planning on getting this for christmas, my wishlist is really short so my parents will have to buy me all of the things that are there (two things, hehe).

Thanks in advance,

Radium. :)

586856005[/snapback]

That book is the definitive tome for C++. It's very good.

I'm also a fan of Accelerated C++ ISBN 020170353X. It's a very good book that deals with how you write in C++. It doesn't touch on anything that deals with C-compatibility, which I think is good.

  • 0
That book is the definitive tome for C++. It's very good.

I'm also a fan of Accelerated C++ ISBN 020170353X. It's a very good book that deals with how you write in C++. It doesn't touch on anything that deals with C-compatibility, which I think is good.

586856039[/snapback]

ah, thanks. Cool! :cool:

If I'm satisfied with Bjarne's book, then I will take a look at "Accelerated C++". :)

I have no plans in becoming a professional programmer, I just like programming as a hobby. I might change my mind later, I don't know. :happy:

  • 0

What is the best way to create a timer in C++? I need a timer which will not cause the application to stop responding and will fire an event according to a given interval.

In other words, I need the C++ alternative to the .NET's timer. Or maybe there's a more simple solution?

Any ideas?

  • 0

You sound like you're looking for an "event" like you would find in .NET. That's not going to happen.

If you need the timer in a Window, use the SetTimer API function. This throws a WM_TIMER message into the window's message queue after each interval. If it's not in a Window, you can use CreateWaitableTimer. That function blocks the calling thread for the specified amount of time, and then resumes execution. Since it does block, you'd need to put that into a secondary thread.

  • 0
I have a LONG value which I want to convert to LPCWSTR - how should I do that?

For C++, you should use stringstream:

std::wstringstream wss;
wss << longValue;
LPCWSTR wStr = wss.str().c_str();

or write a template function once:

template<typename T, typename b_char> std::basic_string<b_char> ToString(const T& t)
{
   std::basicstringstream<b_char> wss;
   wss << t;
   return wss.str();
}

If you are going to use C++, try to avoid C functions, like _ltow and in general try to avoid using fixed-buffers and new()/delete() operations.

  • 0

Thanks but then I get:

d:\my documents\visual studio 2005\projects\colorstest\colorstest\colorstest.cpp(175) : error C2653: 'std' : is not a class or namespace name

d:\my documents\visual studio 2005\projects\colorstest\colorstest\colorstest.cpp(175) : error C2065: 'wstringstream' : undeclared identifier

d:\my documents\visual studio 2005\projects\colorstest\colorstest\colorstest.cpp(175) : error C2146: syntax error : missing ';' before identifier 'wss'

d:\my documents\visual studio 2005\projects\colorstest\colorstest\colorstest.cpp(175) : error C2065: 'wss' : undeclared identifier

d:\my documents\visual studio 2005\projects\colorstest\colorstest\colorstest.cpp(177) : error C2228: left of '.str' must have class/struct/union

type is ''unknown-type''

d:\my documents\visual studio 2005\projects\colorstest\colorstest\colorstest.cpp(177) : error C2228: left of '.c_str' must have class/struct/union

d:\my documents\visual studio 2005\projects\colorstest\colorstest\colorstest.cpp(181) : error C2361: initialization of 'wStr' is skipped by 'default' label

d:\my documents\visual studio 2005\projects\colorstest\colorstest\colorstest.cpp(177) : see declaration of 'wStr'

  • 0

I have a question:

If I have Visual C++ Express 2005 and the Platform SDK, can I develop programs which uses the ATL library? I've heard that the Platform SDK has only the header files of the ATL but not the actual library so I'm not sure. Is the ATL library offered for free or does it only come with the full Visual Studio?

  • 0

I have a question:

If I have Visual C++ Express 2005 and the Platform SDK, can I develop programs which uses the ATL library? I've heard that the Platform SDK has only the header files of the ATL but not the actual library so I'm not sure. Is the ATL library offered for free or does it only come with the full Visual Studio?

ATL and MFC only come with Standard and above. Neither are available in the PSDK either, except in the 64-bit form.

  • 0

I have another question:

I create a TCHAR variable called "lpszPath" to which I assign a certain text. Now I want to show the value of that variable together with a custom text I write in a message box. I've tried this:

MessageBox(NULL, _T("The variable's value is ") + lpszPath, _T(""), 0);

which is obviously wrong, but it didn't work. What is the right way to do it?

  • 0

Oh, sorry - I've found the answer (After many hours of tryings :| :laugh: )

Here's what I had to do:

#include <string>
#include <sstream>

char buffer[8192];
sprintf(buffer, The variable's value is %S", lpszPath);

std::wstringstream message;
message << buffer;

MessageBox(NULL, (LPCWSTR)message.str().c_str(), _T(""), 0);

  • 0

Fixed buffers are bad, use std::wstring.

#include <string>
typedef tstring std::basic_string<TCHAR>;

tstring str(_T("The variable\'s value is "));
str.append(lpszPath); // assuming lpszPath is a LPTSTR

::MessageBox(NULL,  str.c_str(), NULL, 0);

The code you wrote assumed assumed TCHAR is a wchar_t (UNICODE and/or _UNICODE are defined in that case).

Either write UNICODE code only (use WCHAR and the *W() api-set) or use TCHAR and the TEXT() and _T() macros everywhere.

  • 0

Ok, I got inspired today to learn a programing language. I want to learn C++ but I am sitting here with no clue on earth on where to start. Can anyone give me links to newbie tutorials and sites? If you can, please state any tips that you have for me, thanks!

I was in your position a couple months ago, but I reccommend learning Visual Basic first, then learning C++. It's way easier.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • PDF-XChange Editor 11.0.1.0 by Razvan Serea PDF-XChange Editor is a comprehensive PDF editor that allows you to create, view, edit, annotate, and digitally sign PDF documents with ease. With advanced features like OCR, document security, and PDF optimization, PDF-XChange Editor is a powerful tool for both personal and professional use. Whether you need to edit text, images, or links, or add comments, stamps, or watermarks, PDF-XChange Editor provides all the necessary tools to make your PDFs look perfect. Additionally, it supports a wide range of file formats, including PDF, XPS, and DOCX, making it easy to convert and share your documents. PDF-XChange Editor key features: Edit text and images in PDF documents Add and remove pages from PDF files Annotate and markup PDFs with comments, highlights, and stamps Use OCR to convert scanned documents into searchable text Create and fill out PDF forms Sign and certify PDF documents digitally Add and edit hyperlinks within PDFs Extract text and images from PDF files Batch process multiple PDF files at once Customize the interface to your preferences Work with multiple documents in tabs Convert PDFs to other formats such as Word, Excel, and HTML Use advanced redaction tools to permanently remove sensitive information Add customizable headers and footers to PDFs Merge multiple PDF documents into a single file Split PDF documents into multiple files Add watermarks to PDF documents Use the measurement tools to calculate distances and areas in PDFs ....and much more PDF-XChange Editor 11.0.1.0 changelog: Fixed a crash in the new Open/Save dialog box when creating a new folder in an unavailable network path. (49552) Fixed a rare/infrequent crash on some dynamic XFA forms after changing their field values. [installer] Fixed an issue where shortcuts were lost during an upgrade from the previous version. [installer] Fixed an issue preventing migration of serial keys during updates from version 10. Fixed the issues with the shell context menu after installation of version 11. Fixed the issue with filtering comments. (49478) Fixed the issue that caused "Error [IO subsystem]: Invalid access mode." when converting PDFs to MS Office formats. Fixed an issue with the context menu position on some multi-monitor systems. (48467) Fixed an issue with handling complex custom file filters, displayed by JS, in the new Open/Save Files dialog box. (49486) Fixed several issues with the new 'Select Folder' dialog box. (49505) Fixed an issue with the new custom 'Open File' dialog box when using double-click to open it. (49498) Fixed an 'infinite' loop/proliferation in the 'Open Files' and 'Manage Places' dialog boxes. (49526) Fixed an issue with handling the mouse wheel inside the document "Find" box. (49539) Fixed an incorrect behaviour in the 'Go back (Alt+Left)' button in the new Open/Save Files dialog box. (49510) Fixed an issue with the shortcut keys (Alt+Left/Right) after navigating via breadcrumb paths in the new Open/Save Files dialog box. (49554) [installer] Fixed an issue with redrawing the progress text in the EXE installers. Fixed the issue where a mouse click outside of the polyline/polygon context menu during annotation creation would cancel the annotation. (49475) We switched back to using the system Open/Save/SelectFolder dialog box by default, instead of using the new one, because some popular features such as the QuickAccess/Recent items are missing in the new version. These will be added in a future release. Replaced the 'Extension' column in the new Open/Save File dialog box with a more user-friendly 'Type' column. Also fixed some issues when handling the 'Show file extension' option. (49497) Added the ability to authenticate local network shares in the new Open/Save Files dialog box. (49557) Improved the handling of dates after 01.01.2030 in XFA files - now such dates are stored properly when set via the dropdown widget. Flags NoZoom and NoRotate are now respected for only a limited subset of annotations. Download: PDF-XChange Editor (64-bit) | Portable ~300.0 MB (Shareware) Download: PDF-XChange Editor (32-bit) | Portable ~200.0 MB Download: PDF-XChange ARM64 | 276.0 MB Download: PDF-XChange Portable @PortableApps.com | 97.0 MB View: PDF-XChange Editor Website | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Still 3x what it should cost. So, it seems the trick is to increase price by 6x so that a reduction in price back to 4x looks like a steal. "You savvy shoppers win again!" I'm glad I'm not in a desperate spot to actually even need this overpriced crap. Hopefully, it comes back down by the time for when (or if) I ever do.
    • Although AI is great and has it's use cases they likely have massively overhyped it and it has not delivered as per their expectations. I fully expect them to start saying the same things again when it does get to a certain level of intelligence!
    • Microsoft wants to end printer driver headaches with Windows Ready Print by Usama Jawad A few days ago, Microsoft released Windows 11 Experimental build 26300.8553, bringing a ton of enhancements such as Start menu customization, search improvements, Taskbar polish, and other minor UI tweaks. Another relatively major enhancement snuck deep within the change log was related to upgrades to the Windows printing experience. Now, Microsoft has shared more details about these benefits. For starters, Microsoft has renamed its Modern Print Platform to Windows Ready Print. The company believes that this name highlights its shift in strategy, which now focuses on modernizing, securing, and streamlining the printing experience for Windows devices. Some of the upgrades present in Windows Ready Print have already been seeded to customers and partners. This includes ending support for third-party printer drivers via Windows Update and transitioning towards the Internet Printing Protocol (IPP) and the native Windows IPP printer driver. In line with these changes, new printer installations will default to Windows Ready Print on eligible devices starting from July 2026. However, Microsoft recognizes that not all environments will be able to migrate to this platform immediately, so it will allow users to choose between installing the printer via Windows Ready Print or the traditional OEM process. Users will be able to toggle this configuration through Settings > Bluetooth & Devices > Printers & Scanners > Printer preferences. This control applies only to new printer installations, and its functionality can also be modified via Group Policy as follows: Launch Group Policy Editor Navigate to Local Computer Policy -> Administrative Templates -> Printers Find and select 'Configure Windows Ready Print driver ranking' -> double click to open it Select 'Enabled' (if you wish to enable Windows Ready Print driver selection) or 'Disabled' (if you wish to explicitly disable Windows Ready Print driver selection). Select Apply Select OK Similarly, if you set up Windows protected print mode through the same setting in Windows 11, it will also default to using Windows Ready Print exclusively. Microsoft hopes that these improvements will help eradicate dependency on OEM-specific driver installation processes and simplify printer installations. We'll likely find out more about other tangible benefits in the coming months.
  • Recent Achievements

    • One Month Later
      johnjacobb40 earned a badge
      One Month Later
    • One Year In
      Primer1st earned a badge
      One Year In
    • Experienced
      JayZJay went up a rank
      Experienced
    • Reacting Well
      Sir_Timbit earned a badge
      Reacting Well
    • Week One Done
      rubentuben8 earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      513
    2. 2
      PsYcHoKiLLa
      231
    3. 3
      +Edouard
      138
    4. 4
      ATLien_0
      87
    5. 5
      Steven P.
      81
  • Tell a friend

    Love Neowin? Tell a friend!