while waiting for an answer i realised that it may be sunday night, i may have been excommunicated by the community for being way too big and clever, i may have been asking the questions in a stupid way,i personally am half going with excommunication.
@devonrevenge:
Re. the thread which I assume has motivated this one, when seeking advice about programming some specific device it is best to start at the manufacturers website, or similar.
A google search on "raspberry pi c++ programming" produces a rich collection of links to the kind of info you are seeking.
In particular (7th item on 1st page of results) is this thread from here on the subject:
http://www.cplusplus.com/forum/lounge/59297/
I stop helping people as soon as they start PMing me. I don't know what it is, but people seem to think that PMing everyone that posted in their thread will help. If they do this, I lose all respect for them.
There's errors that can occur before you get to eof. while(fin.good())
Is preferred.
The issue remains
1 2 3 4 5 6
while (good)
{
attempt to read x
//failed to read
mess with x
}
The classic `is reading the last element twice'
I don't understand what Duoas refers with `more sophisticated' but looping on the reading is what you need to do, so it would stop when it fails.
by instance while( input>>var )
so there is no c++ port opening commands? or something like that? (given my low level of understanding i dont really know how it works and cant ask a coherent question)
C++ is a general purpose language that is intended to target a vast array of hardware. As you know, the C++ spec doesn't require you to have a keyboard, or a monitor, and only in the most recent version (C++11) have they bitten the bullet and actually discussed the memory model.
Networking is inherently dependent on hardware and the OS, and is (and in my opinion rightly) shunted to APIs and libraries.
ahh okay so i get an api and bother some other apr related forum with windows to linux questions, kay see i didnt know that, i thought it could be like writing a file.
so unless i built my own operating system with c++ or communicate with the hardware with raw data.
that last one sounds tempting to look into, bet its waaay complicated
If you prefer high-level interaction, you can check out liblacewing - otherwise, if you prefer low-level, there's hundreds of libraries and some googling should find you the good ones. Try to use platform-independent ones though - even if you only need it for your platform, it's good to practice writing portable code.
That's another thing; I generally don't help people who try to do things only for their platform, and I especially don't help people who try to do things with the Console window (I generally discourage treating the console as anything but a debugging tool)
I generally don't help people who try to do things only for their platform, and I especially don't help people who try to do things with the Console window (I generally discourage treating the console as anything but a debugging tool)
Well that's dumb. Not every program need to be cross-platform and not every program needs a GUI.
It's annoying when people ask questions they should be able to find the answers for on their own. It's also a bad habit to rely on random forum goers for basic information. It's better to get information directly from the source if you can.
What I mean is, I don't help people who want to know how to do windows-only things like creating shortcuts, and I don't help people who want to e.g. color the output of their console. I've decided to allow other people help them with that instead, with the intention that people who are more familiar with such things than me will help.
That sounds like you just don't help people with things you don't know how to do, which is perfectly reasonable. Before, it sounded like you don't help people with that stuff because you were morally opposed to it, which is dumb. Even if someone is making a cross-platform application, the Windows version might need to make shortcuts. If someone is making a graphical application with a console for debugging, they might still want coloured output (my RPG uses the console window for debug, info and error messages (all three of which are in different colours (grey, white and red respectively)) as well as for interaction with the game engine (like the console in many games, but since my game isn't fullscreen there's no need to reinvent the wheel, I can just use the normal console)). Even so, not every application needs to have their own GUI (don't forget that the console is really just a GUI displaying text), many wouldn't make sense with a GUI because they only need to process text.