Fstream won't take anything but char

Hi.
C++ console programing.
Maybe I'm dumb programer, or I've forgoten something, but before xcode 3.2 everything was working fine.
Now if I try to read form ifstream object or write to an ofstream I have problems. It looks like it will work only with a char.
It use an int it just won't read to it and won't write it to a file.
It I use string, it gives an error and kills program.
Will be thankful for any help.

ok
so code's like this:
#include <fstream>
using namespace std;
int main ()
ifstream input("in.txt");
ofstream output("out.txt");
char a;
input >> a;
a++;
output << a;
return 0;
input file has 3 in it. So when I execute this code i get 4 in file out.txt
But when i change "char a" to "int a" i get just blank out.txt

Similar Messages

  • My iPod Won't Show Anything But A Brighter Black Screen.

    My iPod Touch 5g had been working just fine for the last 8 months, and even this morning. But, as I was getting into my car, I turned it on and nothing but a brighter black screen showed up. After a few tries of just pressing the on/off button it finally turned on. It worked for a while then, it just wouldn't turn on at all. When I got home, I plugged it in to the charger and it did the same brighter black screen. It's like it turns on in the background but doesn't let the actual screen show. I've plugged it into my computer and the wall, I've held the home and on/off button together but neither are working. It will also play music from my speakers if I press play on the speakers but it won't show me anything but a brighter black screen. Any tips?

    Brighter black?  Black is black.  It has no shades.
    Please tell me that it has NEVER been jailbroke.  If that's the case, here are some standard repair procedures:
    First, try a system reset.  It cures many ills and it's quick, easy and harmless...
    Hold down the on/off switch and the Home button simultaneously until you see the Apple logo.  Ignore the "Slide to power off" text if it appears.  You will not lose any apps, data, music, movies, settings, etc.
    If the Reset doesn't work, try a Restore.  Note that it's nowhere near as quick as a Reset.  It could take well over an hour!  Connect via cable to the computer that you use for sync.  From iTunes, select the iPad/iPod and then select the Summary tab.  Follow the on-screen directions for Restore and be sure to say "yes" to the backup.  You will be warned that all data (apps, music, movies, etc.) will be erased but, as the Restore finishes, you will be asked if you wish the contents of the backup to be copied to the iPad/iPod.  Again, say "yes."
    At the end of the basic Restore, you will be asked if you wish to sync the iPad/iPod.  As before, say "yes."  Note that that sync selection will disappear and the Restore will end if you do not respond within a reasonable time.  If that happens, only the apps that are part of the IOS will appear on your device.  Corrective action is simple -  choose manual "Sync" from the bottom right of iTunes.
    If you're unable to do the Restore (or it doesn't help), go into Recovery Mode per the instructions here.  You WILL lose all of your data (game scores, etc,) but, for the most part, you can redownload apps and music without being charged again.  Also, if you have IOS-7, read this.

  • I can't set Firefox to open PHP files with Firefox (in preferences- applications-php files) Firefox won't accept anything but "always ask" and Preview. I want to preview php files in Bbedit and that requires that Firefox can open it.

    with an open php file in Bbedit (Macintosh) it was possible to preview appearance by chosing "Preview in.." in Bbedit's "Markup" menu. This called Firefox to open and display the file. Now, doing this continually repeats a "Open with (choose)" request.

    Unfortunately this solution doesn't work for me for local files (on my computer). Still I can only choose to open in Notepad or "other". It seems that I can select Firefox, but it won't do anything when I actually select it.... I did NOT have this problem with the previous version of Firefox (before 6.0.2). The only thing that's changed, is the Firefox update from yesterday (September 28th, 2011).

  • My 5th gen Ipod won't do anything but show the " Connect to your computer, use itunes to restore" screen. However my computer nor anyone else's will recognize my ipod. What can I do?

    My ipod will not do anything but show a screen that asks to "connect ipod to computer, use itunes to restore" My computer however will not recognize my ipod at all so there is no way to restore my ipod. I am not skilled in computers but if anyone has a step by step that would be great.

    Did you try a hard reset with the iPod still connected to your PC?  Have you tried multiple USB ports, preferably high powered USB 2.0 ports?
    To do a hard reset, first make sure the hold switch is in the Off position, then press and hold both the Select (Center) and Menu buttons together long enough for the Apple logo to appear.
    Have you also worked through each and every single troubleshooting suggestion in this Apple support document?
    iPod not recognized in 'My Computer' and in iTunes for Windows
    B-rock

  • Photosmart 7550 suddenly won't print anything but scanned images?

    Hi all,
    I've had this printer for a while and have had zero problems with it, and I don't think there's one now. More likely a setting I can't find. I just scanned a bunch of stuff that printed up just fine, but text documents, (I use Open Office) and PDF docs will not. I've tested this out and haven't been able to discover what I've done wrong. I can print anything that I've scanned (scanned docs are displayed by Windows Photo Gallery), but no ODT (Open Office) or PDF (Adobe Acrobat). Won't print from e-mail, either. It was all working fine the last time I printed any ODT or PDF, but it has been a couple of months for those, though I was printing e-mails as recently as last week. Also, when I send the command to print, I see the status bar spooling the pages to print, but the printer never reacts. Then when I double click the printer icon in the toolbar, the printer status window that opens shows "printing", but then suddenly it says "deleting" and it disappears and there are no jobs pending.
    I'm using Windows Vista 32-bit. Drivers are up-to-date.
    Can anyone help?

    Hi there,
    Try the steps outlined in this article to ensure we are dealing with a print queue problem. Let us know the results.
    Best of Luck!
    You can say thanks by clicking the Kudos Star in my post. If my post resolves your problem, please mark it as Accepted Solution so others can benefit too.

  • Disappointed!! I've been using Firefox since the start. Had a few problems but nothing insurmountable until now!! I'm using Internet Explorer now as FF constantly crashes and won't open anything but my home page. Someone help.

    FF goes to my homepage and then stays there. Will not open bookmarks or any other sites at all.
    When I close FF it closes the window but remains active. Can't even close the process in task manager and have to reboot PC.
    This seems to have happened when FF upgraded to 6.0. since then I have uninstalled 6.0 and reverted to 4.0 in the hope that this will solve the problem but to no avail.
    I'm now at the end of my tether and I'm no longer using FF. Don't want to use IE but I have no choice until this is resolved or decide which other browser will take FF's place. Anyone help?

    FF goes to my homepage and then stays there. Will not open bookmarks or any other sites at all.
    When I close FF it closes the window but remains active. Can't even close the process in task manager and have to reboot PC.
    This seems to have happened when FF upgraded to 6.0. since then I have uninstalled 6.0 and reverted to 4.0 in the hope that this will solve the problem but to no avail.
    I'm now at the end of my tether and I'm no longer using FF. Don't want to use IE but I have no choice until this is resolved or decide which other browser will take FF's place. Anyone help?

  • Photoshop CS6 won't do anything, but works on a different user profile

    Hello I am receiving the error ‘photoshop could not complete your request because of a programme error’ message any time I try and do anything in photoshop, I can’t open, edit, change any settings or access any menu in photoshop without this error, rendering it, currently, a useless waste of money.
    I am running CS6 on a mac running Mountain lion 10.8.3 everything is up to date, both operating system and photoshop. I have tried deleting prefs, plist files, adobe cleaner and re-installation, all several times and I still have the same problem. I also cannot find any log files, or access anything through help>system information.
    It does work under a new user profile, but I'm not too happy about that as a work around
    I get an error message in the console which says
    5/05/2013 19:26:06.000 kernel[0]: proc 4823: load code signature error 2 for file "CS6ServiceManager"
    15/05/2013 19:26:06.000 kernel[0]: CODE SIGNING: cs_invalid_page(0x1000): p=4823[CS6ServiceManage] clearing CS_VALID
    Can anybody help?

    I am experiencing the same problem with my iPod classic 120GB. When I Connect it to my computer for the first time since I started it, it works fine. The iPod is recognized by the computer and iTunes. When I eject the iPod thru the iTunes interface and reconnect it again (without rebooting my computer) the computer freezes. When I start iTunes again, nothing happens until I remove the iPod from the computer (it is stil displaying 'connected'). Removing the iPod unfreezes the computer. I think it is a software problem but I can't find a solution on the internet for such a problem.
    Can someone help?

  • SE600DV won't do anything but flash Question Mark/MacSmile Folder

    I just acquired an iMac SE600DV-Graphite. it 'powers up' but won't 'start up.' The screen flashes a question mark and that MacSmiley filefolder face. What is wrong and how do I fix it?

    Well the flashing ? means it can't see an OS to start from. Either the HD is bad, corrupted or gone. See if it will boot up with an install CD of OS 9. Don't attempt OS X until you check the firmware. It should be 4.1.9.
    For available upgrades:
    http://docs.info.apple.com/article.html?artnum=86117
    If it won't see the CD-ROM try an external FireWire.
    Good Luck.
    Richard

  • Compiles, but won't output anything but "0"

    I'm using Xinox JCreator LE, trying to run the following code:
    import java.io.*;
    public class Tester {
         //default constructor
         public Tester() {
              //for storing my elements! yay
              Element [] myElements;
              System.out.print("test");
              //read in the file to an array
              myElements = readInElements();
              //make sure it's read in properly
              for (Element e : myElements) {
                   System.out.println(e);
         //read in elements from a comma separated values file
         private Element [] readInElements() {
              Element [] myElements = null;
              System.out.println("test");
              try {
                   //count the number of lines
                   int numLines = 0;
                   BufferedReader count = new BufferedReader(new FileReader("elements.csv"));
                   while (count.readLine() != null) numLines++;
                   count.close();
                   //resize the array
                   myElements = new Element[numLines];
                   numLines = 0;
                   //fill the array
                   BufferedReader in = new BufferedReader(new FileReader("elements.csv"));
                   //get each line, split it around commas, add a new Element to the array
                   String str;
                   while ((str = in.readLine()) != null) {
                        String [] line = str.split(",");
                        //if the file isn't correct, blow up
                        if (line.length != 8) throw new IOException("Malformed input file.");
                        //create the new element in the array
                        myElements[numLines++] = new Element(
                             Integer.parseInt(line[0]),
                             Double.parseDouble(line[1]),
                             line[2],
                             line[3],
                             Integer.parseInt(line[4]),
                             Integer.parseInt(line[5]),
                             Integer.parseInt(line[6]),
                             Double.parseDouble(line[7])
                   in.close();
              } catch (IOException e) {
                   System.out.print(e);
                   System.exit(1);
              return myElements;
         //hello I am a main method how are you today
         public static void main(String [] args) {
              System.out.print("test");
              new Tester();
    }It compiles fine, but when I run it I get this as output:
    --------------------Configuration: Assignment 3 - JDK version 1.6.0_02 <Default> - <Default>--------------------
    0
    Process completed.I'm hoping I'm just missing something very simple because this is quite annoying.

    It worked from the command line; there was an extra class in the folder called "Test" which the IDE defaulted to for some reason. Thanks, I knew it was something stupid :)

  • IPod causes PC Crashing, won't do ANYTHING, but works fine unplugged

    OK, so today I tried booting up iTunes to put some new music on my iPod I had just ripped off of a CD. I clicked on the shortcut, and nothing ever came up. Same thing was happening with Spybot, and a re-install fixed that, so I reinstalled iTunes. Same problem. So I tried installing it to my C:\ instead of my second HDD. Same problem. Also, whenever I go into My Computer
    and click on the J:\ (My Ipod) it just freezes. (This same problem has always been happening, but occasionally only failing when I tried transferring files) So then, while waiting for iTunes to boot and My Computer to unfreeze, I unplugged my iPod to listen to it since I was very bored indeed. BOOM, all of a sudden, 'My Computer' unfroze, and iTunes instantly popped up.
    So, iTunes and everything works fine now, providing the iPod is unplugged. If I plug it in while iTunes is running, it does nothing for about 4 seconds, then freezes, and of course, unfreezes as soon as I unplug the iPod.
    Any ideas as to why this is happening? Oh yeah, and this is likely the cause of most if not, ALL the problems my PC has been having since I built it. I hasn't frozen all day today since I unplugged the iPod, and remember that my iPod has been plugged in from when I first posted my newly built machine until I discovered this today.

    I am experiencing the same problem with my iPod classic 120GB. When I Connect it to my computer for the first time since I started it, it works fine. The iPod is recognized by the computer and iTunes. When I eject the iPod thru the iTunes interface and reconnect it again (without rebooting my computer) the computer freezes. When I start iTunes again, nothing happens until I remove the iPod from the computer (it is stil displaying 'connected'). Removing the iPod unfreezes the computer. I think it is a software problem but I can't find a solution on the internet for such a problem.
    Can someone help?

  • Ipod won't do anything but restore

    Hello,
    I've had my ipod for about 6 months now working fine. All of the sudden when I put a new cd on it, it needs to restore. Fine... but since I had itunes up my ipod showed I had all those songs, but they were empty. I restored it again, and now itunes no longer picks it up and all I can do is restore. It just flashes the do not disconnect screen. I have followed the procedures of switching ports, updating and reinstalling, resetting, and of course restoring. It worked great, now it does not work at all. Please help.
    Thanks... Patrick

    Did you try a hard reset with the iPod still connected to your PC?  Have you tried multiple USB ports, preferably high powered USB 2.0 ports?
    To do a hard reset, first make sure the hold switch is in the Off position, then press and hold both the Select (Center) and Menu buttons together long enough for the Apple logo to appear.
    Have you also worked through each and every single troubleshooting suggestion in this Apple support document?
    iPod not recognized in 'My Computer' and in iTunes for Windows
    B-rock

  • My new android keeps crashing got this one because the other one kept crashing. Don't know what I'm doing wrong new phone won't take calls but old phone answers

    Old and new android are paired somehow the old phone answering calls and TeX but new phone is the active one both phones keep crashing what am I doing wrong.Done multiple factory resets on old phone trying to fix this spent countless hours and days on this

    Sorry but we are unable to provide specific help with the Android operating system. Talking to your mobile provider in person may be helpful.

  • The power went off while my Apple TV was updating. Now it won't do anything but blink fast at me. Anyone know what to do from here?

    Power whent down whils my Apple TV was updating. I get no signal and its blinking rapidly. Anyone know what to do from here?

    Due to the power outage the update was unable to be applied properly. You will need to grab a micro usb cable and restore via iTunes.
    Apple TV (2nd and 3rd generation): Restoring your Apple TV - Apple Support

  • My iTunes Store won't be anything but French

    I bought my Mac Mini in France.
    Back in the UK , I bought a Touch today. Sync'ed up with my Mini and now, when it comes to the iTunes store, it only comes up with the French account creation page (not accessed it before today)
    I can't seem to change it to the UK, to create an account with my UK information.
    Thanks in advance for any help
    Lupo.

    Duh...should have read the forum first...found the Dutch/US problem and the solution therein.
    Quite happy for topic to be deleted.

  • Okay Im thinking I made a mistake, I purchased and ipad 2 and now don't know what to do with it. I turned it on and it won't do anything but show the plug and itune symbol?  Can someone tell me what to do?

    I don't know what to do with my ipad2?

    I'm guessing you did not buy the iPad from Apple. If you did not buy it from Apple, it may very well have an older software version. Only iOS 5 or later is PC independent. If you have an earlier version, a computer with iTunes loaded is required.
     Merry Christmas

Maybe you are looking for

  • Error while running a query-Input for variable 'Posting Period is invalid

    Hi All, NOTE: This error is only cropping up when I input 12 in the posting period variable selection. If I put in any other value from 1-11 I am not getting any errors. Any ideas why this might be happening? I am getting the following error when I t

  • Four fingers swipe won't work on magic trackpad

    Hello, just bought a magic trackpad to use with my macbook pro and a second display. Mainly, I purchased the accessory for the four fingers swipe between full screen apps and it doesn't work. If I change the command to a 3 fingers swipe, it does work

  • Spam update

    hi when i am trying to uddate spam from 18-29 it gives me following error The import was stopped, since an error occurred during the phase IMPORT_PROPER, which the Support Package Manager is unable to resolve without your input. After you have correc

  • InfoPackage OLAP variables used in the ZXRSRU01 INCLUDE - I_STEP value ?

    Dear All, as I am aware OLAP variables used in InfoPackage Data Selection are processed in the standard user exit (EXIT_SAPLRRS0_001) - INCLUDE ZXRSRU01 where the customer created global reporting variables are also processed when queries are run and

  • Web template "0ADHOC" does not exist in the master system error

    Hi to all, The Web template "0ADHOC" does not exist in the master system. Error coming while executing query on web template. Via TCODE RSCUTV27 I have checked the default web template 0ADHOC is already there for adhoc analysis. Please can anyone tel