Search Results

Showing results 1 to 40 of 1000
Search took 0.11 seconds.
Search: Posts Made By: iamthwee ; Forum: C++ and child forums
Forum: C++ 34 Days Ago
Replies: 3
Views: 255
Posted By iamthwee
You mean something like?

#include <iostream>
#include <string>

class Foo
{
public:
std::string sayHello()
{
Forum: C++ 34 Days Ago
Replies: 1
Views: 398
Posted By iamthwee
// strings and c-strings
#include <iostream>
#include <cstring>
#include <string>
#include <vector>

using namespace std;

vector<string> SplitString (string aString)
{
Forum: C++ Oct 30th, 2009
Replies: 27
Views: 131,375
Posted By iamthwee
If it works, it works.

There's no point worrying about if a better methods exists because getch() or anything that simulates its behaviour is going to be non-standard anyway, so your concern is a...
Forum: C++ Oct 23rd, 2009
Replies: 9
Views: 556
Posted By iamthwee
I thought you purposely gave him a dud answer so he would hand it in. Well done you had me fooled.
Forum: C++ Oct 13th, 2009
Replies: 3
Views: 296
Posted By iamthwee
Next time don't leave your h/w to the last minute.
Forum: C++ Oct 13th, 2009
Replies: 9
Views: 491
Posted By iamthwee
get devshed c++

You don't have to add any compilers.
Forum: C++ Oct 11th, 2009
Replies: 8
Views: 332
Posted By iamthwee
oops i meant


vector<bool>setlist;
setlist.push_back(true);
setlist.push_back(false);
setlist.push_back(true);
setlist.push_back(true);
Forum: C++ Oct 11th, 2009
Replies: 8
Views: 332
Posted By iamthwee
I think your easiest answer would be

vector<int>setlist;
setlist.push_back(3);
setlist.push_back(12);
setlist.push_back(4);


string s1 = ",";
cout << "{";
Forum: C++ Oct 11th, 2009
Replies: 8
Views: 332
Posted By iamthwee
Well at the end can't you just do an string erase on the last but one element?

string p = "{1,2,3,24,}";
p.erase(p.length()-2,1);
Forum: C++ Oct 10th, 2009
Replies: 4
Views: 319
Posted By iamthwee
There's only one way you're gonna get this to work.

And that is to get your hardware device to spit out the data with a delimiter.

How you do that is irrelevant in terms of c/c++.
Forum: C++ Oct 10th, 2009
Replies: 3
Views: 282
Posted By iamthwee
Never tried it, but the following looks promising...

http://id3lib.sourceforge.net/
Forum: C++ Oct 10th, 2009
Replies: 3
Views: 282
Posted By iamthwee
If it is an mp3 file I believe this is possible... because they should have mp3 tags.
Forum: C++ Oct 10th, 2009
Replies: 1
Views: 243
Posted By iamthwee
Each character?

I would be inclined to read each line in as a std::string

Then jump through each char in that string.
Forum: C++ Oct 10th, 2009
Replies: 4
Views: 319
Posted By iamthwee
Bingo, without a delimiter you're basically fubar'd
Forum: C++ Oct 9th, 2009
Replies: 3
Views: 307
Posted By iamthwee
I think you should ask your teacher.

Otherwise you could even be wasting your time.
Forum: C++ Oct 8th, 2009
Replies: 8
Views: 241
Posted By iamthwee
Look chicken, the similarities between your little batch programs and real, manly programming languages stop here.

Gotos are essentially an abhorrent unnecessary evil.

They lead to spaghetti...
Forum: C++ Oct 8th, 2009
Replies: 8
Views: 241
Posted By iamthwee
If there was ever a time to use a goto statement. That code just there. In post # 1.

Yep, that would definitely be an essential use of the goto statement.

Wonderful.
Forum: C++ Oct 8th, 2009
Replies: 3
Views: 206
Posted By iamthwee
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 8th, 2009
Replies: 1
Views: 204
Posted By iamthwee
Seeing as you are using std::strings I would look into using the string replace method.

Also beware of using eof to read files it has a hidden gotcha.
Forum: C++ Oct 8th, 2009
Replies: 1
Views: 193
Posted By iamthwee
http://www.daniweb.com/code/snippet216831.html
Forum: C++ Oct 8th, 2009
Replies: 3
Views: 307
Posted By iamthwee
http://en.wikipedia.org/wiki/Secant_method

If you look at the following web page you can see a sample bit of code which does what you probably need.

However, you say that you want to allow the...
Forum: C++ Oct 5th, 2009
Replies: 8
Views: 289
Posted By iamthwee
Maybe the following may be of some help:

http://www.daniweb.com/code/snippet217091.html
Forum: C++ Oct 2nd, 2009
Replies: 7
Views: 359
Posted By iamthwee
For example....


#include <iostream>
#include <string>
#include <algorithm>
#include <vector>

using namespace std;
Forum: C++ Oct 2nd, 2009
Replies: 7
Views: 359
Posted By iamthwee
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: 641
Posted By iamthwee
I think you want to sort your struct, not just an array?
Forum: C++ Oct 1st, 2009
Replies: 7
Views: 359
Posted By iamthwee
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
Solved: Parsing in C++
Views: 680
Posted By iamthwee
Indeed.
Forum: C++ Sep 28th, 2009
Replies: 23
Solved: Parsing in C++
Views: 680
Posted By iamthwee
Well if you WANT to allow duplicates all you need is a std::vector
Forum: C++ Sep 28th, 2009
Replies: 23
Solved: Parsing in C++
Views: 680
Posted By iamthwee
>! myfile.eof()

using that is not advised.

And use std::string instead.
Forum: C++ Sep 28th, 2009
Replies: 1
Views: 790
Posted By iamthwee
maybe you'd have to use Curl or something to save the picture from the website onto your harddrive then call that function.
Forum: C++ Sep 26th, 2009
Replies: 17
Views: 24,463
Posted By iamthwee
Sounds like another fail, I dare people not to help you.
Forum: C++ Sep 17th, 2009
Replies: 3
Views: 579
Posted By iamthwee
set a variable at the beginning then add them all up:

eg.

int total = 0;

for ( int i = 0; i < 10; i++ )
{
total = total + i;
}
Forum: C++ Aug 30th, 2009
Replies: 2
Views: 293
Posted By iamthwee
I was thinking about using the modulus operator to get every third number, then just increment by ten to get the range...


#include <iostream>
#include <string>
#include <vector>

using...
Forum: C++ Aug 27th, 2009
Replies: 7
Views: 443
Posted By iamthwee
too+too+too+too=good (4 variables)

499+499+499+499=1996

http://www.mathforum.com/library/drmath/view/57968.html
http://www.geocities.com/Athens/Agora/2160/primer.html#HOW
Forum: C++ Aug 27th, 2009
Replies: 4
Views: 278
Posted By iamthwee
Woah, I don't understand the purpose of this.

Normally you pay for hosting on a website which gives you access to database. Those websites normally run php as the de facto as well.

You can...
Forum: C++ Aug 26th, 2009
Replies: 8
Views: 305
Posted By iamthwee
I know you can attach zip files to forum posts. Not sure about snippets.
Forum: C++ Aug 26th, 2009
Replies: 11
Views: 520
Posted By iamthwee
Maybe might be of use?

http://www.daniweb.com/code/snippet900.html
Forum: C++ Aug 26th, 2009
Replies: 8
Views: 305
Posted By iamthwee
That sounds like a good tutorial as it is quite a popular topic I can imagine.

If I remember the tutorials gets vetted but there is not from stopping you posting it as a snippet with comments for...
Forum: C++ Aug 26th, 2009
Replies: 2
Views: 200
Posted By iamthwee
Do you have a sample input file to post?

And sample input from the command prompt etc.
Forum: C++ Aug 26th, 2009
Replies: 3
Code Snippet: Complete CSV Reader
Views: 1,172
Posted By iamthwee
This is a very useful snippet. Kudos.
Showing results 1 to 40 of 1000

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC