Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Tagged as

Go to top

Help Pointers and chars in C++;

, 13 Nov 2012
When I do this:char *suit = "Hearts"; cout<<*suit;it prints Hearts;It shouldn't, it should print the character 'H' only. What you do is, you dereference the pointer-to-char, so it is only a char. That's why it's only the char that is printed from your class. If you wish the class to...

Revisions


  

Compare Revision Minor Date Status Editor
publicly available No 13-Nov-12 7:24 Available Orjan Westin
Updates in content. 12 changes had been made.
1 No 13-Nov-12 7:22 Available Orjan Westin

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Orjan Westin

United Kingdom United Kingdom
Orjan has worked as a professional developer - in Sweden and England - since 1993, using a wide range of languages (C++, Pascal, Delphi, C, C#, Visual Basic, PHP, Python and x86 assembler), but tends to return to C++.

| Advertise | Privacy | Mobile
Web04 | 2.8.140916.1 | Last Updated 13 Nov 2012
Article Copyright 2012 by Orjan Westin
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid