Forum: C++ Nov 2nd, 2009 |
| Replies: 1 Views: 413 // strings and c-strings
#include <iostream>
#include <cstring>
#include <string>
#include <vector>
using namespace std;
vector<string> SplitString (string aString)
{ |
Forum: C++ Oct 8th, 2009 |
| Replies: 3 Views: 206 Why would anyone download a zip file from a relatively unknown user which could contain ANYTHING?
Especially without any real description of what it might be or sample code snippets?
Nope. |
Forum: C++ Oct 2nd, 2009 |
| Replies: 7 Views: 361 For example....
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std; |
Forum: C++ Oct 2nd, 2009 |
| Replies: 7 Views: 361 Yep, and thinking out aloud...
I assume you have to add the third parameter pos which will either be single, start-end or start-middle-end and no other case.
Therefore if you sort your file by... |
Forum: C++ Oct 1st, 2009 |
| Replies: 6 Views: 656 I think you want to sort your struct, not just an array? |
Forum: C++ Oct 1st, 2009 |
| Replies: 7 Views: 361 Hmm, I don't know why you're fixated on using a map.
Why not create your own object/class?
class Something
{
public:
char letter; //a |
Forum: C++ Sep 30th, 2009 |
| Replies: 23 Views: 682 |
Forum: C++ Jul 21st, 2009 |
| Replies: 8 Views: 355 > BTW, iamthwee, you forgot a zero at the end of the number
yeah a typo, I still think you need the +1 which makes the answer
30.89, which rounds to 31?
For example in his example:
4th week... |
Forum: C++ Jul 17th, 2009 |
| Replies: 7 Views: 440 I think, and I say this cautiously because I'm not too sure, as your error log is quite ambiguous.
But is there a problem with the number of arguments you are passing? |
Forum: C++ Jul 17th, 2009 |
| Replies: 1 Views: 162 You have an idea.
Get a random number 1-3
If 1 then rock
if 2 then scissors
if 3 then paper
Yes? |
Forum: C++ Jul 16th, 2009 |
| Replies: 1 Views: 216 here (http://lmgtfy.com/?q=term+paper+topic+c%2B%2B) |
Forum: C++ Jul 13th, 2009 |
| Replies: 4 Views: 324 Or those of you that like using std:strings etc.
#include <algorithm>
#include <cctype>
#include <iostream>
#include <string>
int lowercase ( int c )
{ |
Forum: C++ Jun 30th, 2009 |
| Replies: 10 Views: 446 Erm do we look like an online compiler service? |
Forum: C++ Jun 3rd, 2009 |
| Replies: 4 Views: 256 Explain your question again? |
Forum: C++ Jun 1st, 2009 |
| Replies: 6 Views: 347 -iostream.h should be iostream
-it's int main
-you're mixing index with the variable i
etc etc and use tags next time. |
Forum: C++ May 29th, 2009 |
| Replies: 16 Views: 653 >As for the monkey statement, find me a video of a big furry monkey programming in c++ and successfully compiling and I'll get you a cookie the size of the big joyous grin I'll have for you.
I've... |
Forum: C++ May 29th, 2009 |
| Replies: 16 Views: 653 Nobody is gonna do that for you. Seriously?
However, here are a few things I have noted.
hello world in java
interface Printer
{
void print ( Message message );
} |
Forum: C++ May 27th, 2009 |
| Replies: 2 Views: 178 maybe rec[0] == rec[rec.length()-1] |
Forum: C++ May 20th, 2009 |
| Replies: 10 Views: 560 At the moment the way you're doing it, looks more like c than c++.
I would be tempted to read the file in line by line (getline), delimit it using space (istream), parse it to check whether the... |
Forum: C++ May 1st, 2009 |
| Replies: 1 Views: 263 graphics.h + dos.h = antiquated turbo c++
Not many people use le antiquated turbo c++ because, well it just sucks.
I would just download it and experiment with it. |
Forum: C++ Apr 8th, 2009 |
| Replies: 19 Views: 1,351 http://www.daniweb.com/code/snippet233.html, oops missed the purpose of calculating last non-zero digit which makes the algorithm simpler. :) |
Forum: C++ Apr 5th, 2009 |
| Replies: 14 Views: 1,058 >You could tokenize (strtok) by "<" and stick each piece into a vector or so... then get it's size().
Best not to mix c with c++. Naughty naughty :-0
In any case all these suggestions are too... |
Forum: C++ Mar 23rd, 2009 |
| Replies: 3 Views: 960 Indeed, but we're not a homework writing service. |
Forum: C++ Mar 5th, 2009 |
| Replies: 7 Views: 869 Try this:
#include <iostream>
#include <string>
#include <stack>
class Foo
{
public: |
Forum: C++ Feb 4th, 2009 |
| Replies: 2 Views: 599 #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <sstream>
using namespace std;
int main()
{ |
Forum: C++ Jan 31st, 2009 |
| Replies: 5 Views: 276 For humour I decided to compile and run it after a few mods:
test.cpp
#include <iostream>
#include <conio.h>
#include <process.h>
using namespace std; |
Forum: C++ Jan 16th, 2009 |
| Replies: 8 Views: 1,084 > if that was the intention of the question, fine, but otherwise it is a very stupid question.
Maybe it was. (assuming you take midpoints of partial sums)... |
Forum: C++ Dec 23rd, 2008 |
| Replies: 15 Views: 1,064 #include "verySmallViolins.h"
Absolutely essential when handing in homework that is late. |
Forum: C++ Nov 5th, 2008 |
| Replies: 11 Views: 1,083 OK I've had enough of this nonsense, you're on your own now.
Ha ha ha. |
Forum: C++ Sep 1st, 2008 |
| Replies: 8 Views: 725 Yes I have no issue on windowsxp using dev-cpp, but with ubuntu (under a vmware environment) I do.
#include <iostream>
#include <string>
using namespace std;
int main()
{
string a =... |
Forum: C++ Aug 29th, 2008 |
| Replies: 8 Views: 656 |
Forum: C++ Aug 27th, 2008 |
| Replies: 2 Views: 1,063 Doesn't isdigit expect a char? |
Forum: C++ Aug 21st, 2008 |
| Replies: 11 Views: 708 Please find program below:
#include <iostream>
#include <string>
using namespace std;
#define FOR_LOOPS cout << "* * * * *\n_ * * * *\n_ _ * * *\n_ _ _ * *\n_ _ _ _ *"; |
Forum: C++ Aug 21st, 2008 |
| Replies: 7 Views: 885 For your information:
http://www.cprogramming.com/tutorial/stl/iterators.html |
Forum: C++ Aug 12th, 2008 |
| Replies: 9 Views: 604 >what should i do now?
Debug it. |
Forum: C++ Jun 22nd, 2008 |
| Replies: 4 Views: 1,092 #include <string>
#include <sstream>
#include <iostream>
using namespace std;
class Foo
{
public:
double bar ( string line ) |
Forum: C++ Jun 20th, 2008 |
| Replies: 5 Views: 1,093 You need to read a basic tutorials on arrays... Seeing this is c++ have a look at std::strings as well. |
Forum: C++ Jun 18th, 2008 |
| Replies: 7 Views: 692 That's a long winded way of doing it:
Other options include using std::strings and relevant functions such as substr()
And other c-style string functions... |
Forum: C++ May 26th, 2008 |
| Replies: 6 Views: 1,646 #include <stdlib.h>
#include <stdio.h>
#include <time.h>
#define MAX_DIGITS 1024
void gradeSchool ( int *a, int *b, int *ret, int d );
void doCarry ( int *a, int d );
void getNum ( int... |
Forum: C++ Feb 14th, 2008 |
| Replies: 7 Views: 3,137 >Make simple things easy.
Here, here. But what about the newlines and/or tabs? |