473,385 Members | 1,325 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,385 software developers and data experts.

font size and saveing/loading

I am working on a rather basic text based adventure useing dev-C++ and running in DOS i am useing windows vista and XP. i made a menu type of area on the screen and if u change locations it labels where u are but if the locations name is too long it moves my borders for the menu... im looking to make the fonts change if the size of the info is too large.

As for saving and laoding i have set up a code that i found online ( with some editing to work with my program) it seems to save all the info correctly but when i load it the info is garbled or set to odd places/numbers. it even removes the classes i have set while all this info is set to be saved.

this is the code i am useing for the save/load i dont have any idea on the font size :

Expand|Select|Wrap|Line Numbers
  1.  {
  2.                           system ("cls");
  3.                           cout << "Enter the name of the file you want to open: ";
  4.                           cin >> FileName;
  5.                           ifstream TUD(FileName);
  6.                           TUD >> name >> lvl >> def >> exp >> max >> min >> gold >> healthmax >> manamax >> armo >> weap >> exp >> race >> numring >> nummana >> numhea >> nummaxmana >> nummaxhea;
  7.                           system ("pause");
  8.                           system ("cls");
  9.                           cout << "It is best to maximize this window or you will have to scroll alot.\n\n";
  10.                           system ("pause");
  11.                           goto Menu;
  12.                           }
  13.  
  14.  {
  15.                             system ("cls");
  16.                                cout << "\nEnter the name of the file you want to create: ";
  17.                                cin >> FileName;
  18.                                ofstream TUD(FileName, ios::out);
  19.                                TUD << name  << "\n" << lvl  << "\n" << "\n" << def  << "\n" << "\n" << exp  << "\n" << max  << "\n" << min << "\n" << gold << "\n" << healthmax << "\n" << manamax << "\n" << armo << "\n" << weap << "\n" << exp << "\n" << race << "\n" << numring << "\n" << nummana << "\n" << numhea << "\n" << nummaxmana << "\n" << nummaxhea;
  20.                                system ("pause");
  21.                                goto Menu;
  22.                        }
  23.  
Apr 1 '08 #1
1 1431
weaknessforcats
9,208 Expert Mod 8TB
I am suspicious of your using the >> operator to read the file and to get the file name. This operator assumes a formmatted file where the extraction stops on whitespace.

I would feel better of you used getline() to enter the file name and to use a binary read on the file unless you know it is a text file.
Apr 1 '08 #2

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

Similar topics

6
by: Liam Gibbs | last post by:
Does anyone know how to make input fields smaller, using a smaller font? I want to know how to make my textboxes and such like the ones at http://www.gracenote.com/music/ , but reading teh code...
115
by: J | last post by:
I've run CSSCheck on my style sheets and I always get a warning similar to this: "font: bold 9pt/100% sans-serif Warning: Absolute length units should not generally be used on the Web ..." ...
9
by: Dr John Stockton | last post by:
Assuming default set-ups and considering all reasonable browsers, whatever that may mean, what should an author expect that his readers in general will see (with visual browsers) for a page with...
4
by: tshad | last post by:
I am having trouble with links in my DataGrid. I have Links all over my page set to smaller and they are consistant all over the page in both Mozilla and IE, except for the DataGrid. Here is a...
7
by: Sakharam Phapale | last post by:
Hi All, How to preserve the old font properties while changing new one? I posted same question 2 months back, but I had very small time then. eg. "Shopping for" is a text in RichTextBox and...
5
by: Christian Stapfer | last post by:
After switching from Python 2.3 to 2.4 (Enought), PIL throws an exception that did not occur formerly (under Python 2.3) when executing ImageFont.truetype(font, size) where font =...
5
by: ajaymohank | last post by:
Hello friends.... my problem is that i have 2 dropdown in which the second drop down will get filled based on the value selected in the first drop down. the values in both dropdown are displayed in...
3
by: Phil Stanton | last post by:
Correct me if I'm wrong, but is it impossible to change the font in a report field when in print preview (MDE database) or can it only be done in design view in the MDB database. Part of my...
2
by: kheitmann | last post by:
OK, so I have a blog. I downloaded the "theme" from somewhere and have edited a few areas to suit my needs. There are different font themes within the page theme. Long story short, my "Text Posts"...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.