473,835 Members | 1,711 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Converting Int to String...

For some reason the following code is not compiling.
void Find_score(void )
{
glColor3f(1.0,0 .0,0.0);
std::ostringstr eam ostr; //turn int score into a string
ostr << score; //score is defined some where
else
std::string LL = ostr.str();
glRasterPos3f (4.5F, -5.5F, 1.0F);
for(int i=0;i<=10;i++) //its never going to have more than 10
digits
{
switch(LL[i]) //if first number in score is one, draw
1...etc.
{
case '1':
drawString ("1"); //drawstring function is
declared somewhere else
break;
case '2':
drawString ("2");
break;
case '3':
drawString ("3");
break;
case '4':
drawString ("4");
break;
case '5':
drawString ("5");
break;
case '6':
drawString ("6");
break;
case '7':
drawString ("7");
break;
case '8':
drawString ("8");
break;
case '9':
drawString ("9");
break;
case '0':
drawString ("0");
break;
}
}
glRasterPos3f (4.0F, -5.5F, 1.0F);
drawString ("Points:");
}

The only error i get is " aggregate `std::ostringst ream ostr' has
incomplete type and cannot be defined " and i don't get why its doing
that. Can someone tell me what that means?

Sep 3 '05 #1
2 2372
bballmitch wrote:
For some reason the following code is not compiling.
void Find_score(void )
{
glColor3f(1.0,0 .0,0.0);
std::ostringstr eam ostr; //turn int score into a string
ostr << score; //score is defined some where
else
std::string LL = ostr.str();
glRasterPos3f (4.5F, -5.5F, 1.0F);
for(int i=0;i<=10;i++) //its never going to have more than 10
digits
{
switch(LL[i]) //if first number in score is one, draw
1...etc.
{
case '1':
drawString ("1"); //drawstring function is
declared somewhere else
break;
case '2':
drawString ("2");
break;
case '3':
drawString ("3");
break;
case '4':
drawString ("4");
break;
case '5':
drawString ("5");
break;
case '6':
drawString ("6");
break;
case '7':
drawString ("7");
break;
case '8':
drawString ("8");
break;
case '9':
drawString ("9");
break;
case '0':
drawString ("0");
break;
}
}
glRasterPos3f (4.0F, -5.5F, 1.0F);
drawString ("Points:");
}

The only error i get is " aggregate `std::ostringst ream ostr' has
incomplete type and cannot be defined " and i don't get why its doing
that. Can someone tell me what that means?


You didn't include <sstream>, most likely.

V
Sep 3 '05 #2
oh yeah. :P my bad. that was stupid. thanks

Sep 3 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3325
by: Cyde Weys | last post by:
I'm currently working on converting a simulator program from Visual Basic 6.0 to Visual C++ .NET. I've figured out most of the stuff, but there's still one thing I haven't gotten to and I've never really had to deal with it before. I'm programming a front-end for what is a compiled Fortran program. The VB source does the following to call the Fortran: 'Defines the subroutine. Declare Sub Cycle_DW Lib "cycdw.dll" Alias "CYCDW" (ByRef...
9
2595
by: Edward Diener | last post by:
I received no answers about this the first time I posted, so I will try again. My inability to decipher an MSDN topic may find others who have the same inability and someone who can decipher and explain it. I have some questions about the instructions for creating a mixed mode DLL in the MSDN topic "Converting Managed Extensions for C++ Projects from Pure Intermediate Language to Mixed Mode" in the "Managed Extensions for C++ Reference"....
13
3983
by: Paraic Gallagher | last post by:
Hi, This is my first post to the list, I hope somebody can help me with this problem. Apologies if it has been posted before but I have been internet searching to no avail. What I am trying to do is provide a simple method for a user to change a config file, for a test suite. The config file consists of a number of keys, eg. build number, target device, etc.
3
28531
by: Wallace | last post by:
Hai, Can anyone tell how to convert an object into string? Please help me.... urgent.. Thanx in advance...
4
3201
by: gg9h0st | last post by:
i'm a newbie studying php. i was into array part on tutorial and it says i'll get an array having keys that from member variable's name by converting an object to array. i guessed "i can get public members but not protected, private, static members"
9
2581
by: Terry | last post by:
I am converting (attempting) some vb6 code that makes vast use of interfaces. One of the major uses is to be able to split out Read-only access to an obect. Let me give you a simple (contrived) example: In Project RoObjDefs: RoPerson.cls file: Public Property Get FirstName() as String Public Property Get LastName() as String <end of file RoPerson.cls> RoPersons.cls file Public Function Count() as Integer
5
23472
by: SMichal | last post by:
Hi, how can I parse string "? 20.000" to double ?
3
2410
by: nvx | last post by:
Hi, I'm looking for a simple way to convert a Double to a String exactly the .ToString() does, except these two differences: - the number of decimals is given (rounding is applied if necessary), and - trailing zeroes are kept. This means I need it to be converted using the scientific notation if the number is greater than a certain value etc., not just a simple "this number of digits (or more if needed) before the decimal point
2
4012
by: CoreyWhite | last post by:
Problem: You have numbers in string format, but you need to convert them to a numeric type, such as an int or float. Solution: You can do this with the standard library functions. The functions strtol, strtod, and strtoul, defined in <cstdlib>, convert a null- terminated character string to a long int, double, or unsigned long. You can use them to convert numeric strings of any base to a numeric
10
3248
by: Hank Stalica | last post by:
I'm having this weird problem where my code does the following conversion from string to float: 27000000.0 -27000000.00 2973999.99 -29740000.00 2989999.13 -2989999.25 The number on the left is the string I get after tokenizing a bigger string. The number on the right is the number I get after the conversion.
0
9803
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10523
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10560
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9345
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7766
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6966
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5636
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5804
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3088
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.