What do the symbols and operations mean in resolving C++ text problems?

  • Context: C/C++ 
  • Thread starter Thread starter ere
  • Start date Start date
  • Tags Tags
    Operations Text
Click For Summary
SUMMARY

The discussion focuses on resolving C++ text problems, specifically the use of the pound sign (#) and the multiplication operator (*) with text variables. The pound sign indicates a reference to the previous value of the variable, while the multiplication operator can be overloaded to define specific behaviors, such as repeating a string when multiplied by a number. For example, the expression t1 = #t1 + #t1 results in concatenating the string stored in t1 with itself. Understanding these operations is crucial for effectively manipulating text in Resolve/C++.

PREREQUISITES
  • Familiarity with C++ syntax and operations
  • Understanding of operator overloading in C++
  • Knowledge of string manipulation techniques in C++
  • Basic concepts of preprocessor directives in C++
NEXT STEPS
  • Research C++ operator overloading techniques
  • Explore string manipulation functions in C++
  • Learn about preprocessor directives in C++
  • Investigate the Resolve programming language and its syntax
USEFUL FOR

Students learning C++, software developers working with text processing, and anyone interested in understanding operator overloading and string manipulation in programming.

ere
Messages
9
Reaction score
0
i am faced with some homework in Resolve/C++ and encountered several problems

Code:
	ensures
	    t1 = #t1 * #t2

-what do the pound signs before the variables mean?
-what does it mean when one text "*" another text?

hope someone can help. can't really find much resolve/C++ help online. thanks!
 
Technology news on Phys.org
# is reserved for the preprossor.
Either there is a definition somewhere that says #define t1 = "blah" or somehow the code has got screwed up in the email / web page.

Multiplying text can mean whatever you overload the operator to mean. Text * a number might reasonably mean repeat the text 'number' times but multiplying text * text is probably a silly thing to do.
 
#t1 is the previous value of t1.
If t1 is originally "cat", then t1 = #t1 + #t1 means t1 will be "catcat"
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
2
Views
3K
Replies
6
Views
3K
Replies
3
Views
27K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 11 ·
Replies
11
Views
5K
Replies
5
Views
3K
  • · Replies 8 ·
Replies
8
Views
6K
  • · Replies 7 ·
Replies
7
Views
2K