• 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

    • Sadly, that is the state of things. It's basically considered acceptable for any random app running on your computer to use 1+ GB of RAM, and install space, lol, no one even seems to consider that.
    • EU Commission explains why Siri AI isn't launching in the EU, and Apple is to blame by Hamid Ganji Image via Apple This week at Apple’s 2026 developers conference, the iPhone maker unveiled the upgraded Siri after more than a year of delays. The new Siri is now called Siri AI, and it's powered by Google Gemini models. While Siri AI is preparing to roll out to Apple users worldwide, the company’s EU customers might need to wait much longer before getting their hands on the new assistant. Shortly after announcing iOS 27, Apple said in a blog post that Siri AI is not coming to the EU anytime soon due to hurdles posed by the Digital Markets Act (DMA) and other regulatory requirements. To comply with the DMA in the EU, Apple apparently needs to open Siri AI to rival assistants on iOS 27 and iPadOS 27. Apple has refused to do so, which has resulted in Siri AI being delayed for its EU users. The company argues that such a move would put users’ privacy at risk. In a statement to Neowin, a European Commission spokesperson provided more details about why Siri AI will not be rolled out to Apple customers in the region. The statement first noted that the DMA does not prohibit Apple from launching its services in the EU and that the company is simply required to comply with the law. The European Commission spokesperson added that, since Apple is considered a gatekeeper under the DMA, it is “obliged to give third parties access to equivalent features as they give to its own products. Because the DMA is precisely about giving users the choice to use the product they find best suits their needs.” Moreover, the spokesperson said the Commission has been in contact with Apple, though the company “did not develop proposals for DMA compliant interoperability solutions.” The statement also clarified that companies designated as gatekeepers cannot leverage their status and products, such as operating systems, to favor their own AI services. The first public beta of iOS 27 will roll out next month, while the stable version is expected to launch this fall following the release of the iPhone 18 series. It remains unclear when Apple will be able to resolve its DMA-related compliance issues with the European Commission and bring Siri AI to its European customers.
    • i wish i could uninstall Chrome from Anrdoid...  
    • XMedia Recode 3.6.3.1 by Razvan Serea XMedia Recode is a free video and audio converter. XMedia Recode supports nearly all audio and video codecs. With XMedia Recode you can easily convert nearly all film and music files in the format you want. Convert for countless devices, select the predefined profile (iPhone, iPad, iPod Touch, Android-Tablets, Sony PSP, Amazon Kindle, Smartphones Blackberry, Wii und DS, Cowon, Android, HTC, Xbox360, Samsung, LG). XMedia Recode converts: 3GP in AVI, 3GP in FLV, AC3 in MP3, AC3 in WAV, ASF in 3GP, ASF in FLV, ASF in MP4, AVI in FLV, AVI in 3GP, FLAC in MP3, FLAC in WMA, FLV in 3GP, FLV in Mp3, DVD in 3GP, DVD in AC3, DVD in AVI, DVD in MP3, DVD in MP4, DVD in MOV, DVD in SVCD, DVD in VCD, DVD in WMV, OGG in MP3, OGG in WMA, MPEG in AVI, MP2 in MP3, MP4 in FLV, MP4 in AVI, M4P in MP3, MOV in 3GP, MOV in AVI, MOV in FLV, WMA in MP3, WMV in FLV, WAV in MP3. Main functions of XMedia Recode: Extracts audio tracks from DVD, Blu-ray and video files Framework also freely selectable color (Padding) Drag-n-drop of video files directly on the encoder Selection display format (1: 1, 3:2, 4:3, 5:4, 5:6, 11:9,16: 9, 16:10, 2.21: 1) Zoom shot (none, type character box, media, Pan Scan, to screen) ''Direct Stream'' copies the audio stream or video stream into the target format 2-Pass-Encoding Volume correction Can change framerate, bit rate, resolution Can extract audio stream of most video formats Produce DVD copies for mobile phones, various mobile devices Edit Video: Color correction Video cut Cropping Denoise Delogo Deblocking De-interlacing Flip Image Start Time End Time Resolution Rotate Image Sepia Sharpness Padding Video fade in / fade out XMedia Recode 3.6.3.1 changelog: Update of ffmpeg Updated AOM AV1 Codec (3.14.1) Fixed minor bugs Download: XMedia Recode 64-bit | Portable ~20.0 MB (Freeware) Download: XMedia Recode 32-bit | Portable View: XMedia Recode Website | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • This has been on the roadmap for years, nothing really new here. This is one of the few areas where Microsoft is making Windows better. Universal print is a very good things and so far works as expected. The last step is ending the option for 3rd parties to add traditional custom drivers. It is somewhat of a hurdle, but it is for a long-term good. The downside is that printer manufactures are likely going to use this as an excuse to force users onto new printers. Considering this roadmap has been public for years, then printers sold during that time should be covered...but I'm sure they will have a different opinion.
  • Recent Achievements

    • One Month Later
      pinnclepd earned a badge
      One Month Later
    • First Post
      X-No-file earned a badge
      First Post
    • 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
  • Popular Contributors

    1. 1
      +primortal
      508
    2. 2
      PsYcHoKiLLa
      213
    3. 3
      +Edouard
      145
    4. 4
      Steven P.
      86
    5. 5
      ATLien_0
      83
  • Tell a friend

    Love Neowin? Tell a friend!