473,324 Members | 2,268 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Need help with strings and coloring text fast, please.

Hi, I wanna know how to avoid the program to scan only the first letter of a string... I know it sounds real n00bish, but if you could post a simple example (SIMPLE, not like the help menu from c++) through C++ it'd be awesome :D.

Also, I would like to know how to color a text (What library should be used, how do you use a variable to color the text, and so on...).


P.S: The reason I need it fast is because I need to deliver a work tomorrow at college (about 30% of the total grade).

Thanks a lot in advanced. :)
Nov 23 '06 #1
3 1232
sivadhas2006
142 100+
Hi,

To skip the character use the following function.

Expand|Select|Wrap|Line Numbers
  1. getch()
  2.  
To print the colorful text use the following functions.

Expand|Select|Wrap|Line Numbers
  1. textcolor(WHITE); and 
  2. cprintf("Colored Text")
  3.  
  4.  
Regards,
M.Sivadhas.
Nov 23 '06 #2
QryS
3
I wanna know how to avoid the program to scan only the first letter of a string...

Hi
try
#include<iostream.h>

void main()
{
char str[10];
cout<<"\n Enter name";
cin.getline(str,10);
cout<<str;
}
It will alow you to enter 9 char because last char in array has to be \0. User can enter more letters on the screen but only first 9 will be in str. You can vary second argument of getline() which is no of char you want to enter remember to change str to the same number or bigger.
good loock
Nov 23 '06 #3
Thanks you guys ^^ That helped a lot :)
Nov 23 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Markk | last post by:
Hi. I would like to ask If somebody don't have any small sample to coloring XML syntax, e.g. in RichTextBox. It can be in VB.NET or C#. I watched on SharpDevelop, but I could not understand...
14
by: Nick Z. | last post by:
I have a file that I want to read a UTF-16 unicode string from. What is the easiest way to accomplish that? Thanks in advance, Nick Z.
7
by: Timo Haberkern | last post by:
Hi there, i have some troubles with my TSearch2 Installation. I have done this installation as described in http://www.sai.msu.su/~megera/oddmuse/index.cgi/Tsearch_V2_compound_words...
40
by: apprentice | last post by:
Hello, I'm writing an class library that I imagine people from different countries might be interested in using, so I'm considering what needs to be provided to support foreign languages,...
95
by: hstagni | last post by:
Where can I find a library to created text-based windows applications? Im looking for a library that can make windows and buttons inside console.. Many old apps were make like this, i guess ...
3
by: Robert Dailey | last post by:
Hi, I've gone through tons of XML editors: - XML Spy - Oxygen - UltraEdit - PSPad - Many others I can't think of...
8
by: SaltyBoat | last post by:
Needing to import and parse data from a large PDF file into an Access 2002 table: I start by converted the PDF file to a html file. Then I read this html text file, line by line, into a table...
1
by: sukatoa | last post by:
The code below, //I need help here.... public void processChangedLines(int offset, int length) throws BadLocationException { String text = getText(); ResetColor(); ...
4
by: smartic | last post by:
Hi everyone. I'm having problem with firefox only but it works when i delete document definition that is my code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.