Jump to content

Welcome to noName.zone
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. If you already have an account, login here - otherwise create an account for free today!
Photo

c++

- - - - -

3 replies to this topic

#1
Roohan

Roohan

    Suggest me a gaming name

  • Members
  • 503 posts
  • Country: Country Flag
  • Locationkharian cty

Hey guys,

so im back with another simple question.

i just want to know if there is a variable to declare both character and operation signs like " + , -"

for example: " c+ ". i want to store "c+" in a variable for later use..

 

 

Spoiler


#2
Acea

Acea

    The fallen

  • Forum user
  • PipPip
  • 363 posts
  • Country: Country Flag

Well, you can store that in a simple var using std::string but what's the point?

 

+ Google is your friend for programming. All questions have been asked and answered.


Posted Image


#3
QuickBreakdown

QuickBreakdown

    0100100101

  • Administrators
  • 604 posts
  • Country: Country Flag

yes you can use std string

#include <string>
#include <iostream>
 
void main()
{
  std::string test = "hello from c++";
  std::cout << test << std::endl;
  return 0;
}

endl is the end of line seperator depending on your platform

string is actually a class that contains many methods like size() and append(), check http://www.cplusplus...ring/?kw=string



#4
Roohan

Roohan

    Suggest me a gaming name

  • Members
  • 503 posts
  • Country: Country Flag
  • Locationkharian cty

thanks

i was using string in switch xD





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users