Ye55 the keyboard im u5ing doe5 have a broken key.
But anyway5, Im wondering what language I 5hould learn.
Not for any 5pecific purpo5e5 but what do you think i5 the be5t programing language ju5t over all?
Printable View
Ye55 the keyboard im u5ing doe5 have a broken key.
But anyway5, Im wondering what language I 5hould learn.
Not for any 5pecific purpo5e5 but what do you think i5 the be5t programing language ju5t over all?
Engli5h. ;)
Seems the 's' key was good enough to type your name, and compose your other post
http://www.catb.org/~esr/faqs/smart-...html#writewell
Not exactly a C# related question, is it?
nope - moved.
Even if you do have a broken key, buy a new keyboard! They arn't THAT expencive.
How do you expect to be able to program with a broken s and S?
Code:#include <io5tream>
#include <5tring>
int main() {
5td::5tring foo = "Hello World!";
5td::cout << foo;
return 0;
}
Very funny, 5lyMael5trom :)
Code:#define 5 s
How would you type the s?
Obviously considered, but it would be quite difficult to do without an s key to set the define. Instead, we would have to supply him with a little pre-preprocessor that replaces all instances of a set token with 's'So who wants to compile this and upload it for the poor kid?Code:#include <iostream>
#include <fstream>
#include <string>
#include <cstring>
int main(int argc, char* argv[]) {
std::string lineBuff, dataBuff;
std::ifstream inFile;
std::ofstream outFile;
if(argc != 3 || strlen(argv[2]) != 1) {
std::cerr << "Usage: " << argv[0] << " <data source> <token>";
return 1;
}
inFile.open(argv[1]);
while(inFile >> lineBuff)
dataBuff += lineBuff + '\n';
inFile.close();
while(dataBuff.find(argv[2]) != std::string::npos)
dataBuff[dataBuff.find(argv[2])] = 's';
outFile.open(argv[1]);
outFile << dataBuff;
outFile.close();
return 0;
}