2,839 Posted Topics

Member Avatar for Xantox

[QUOTE=Sky Diploma;1021372] And if you want a better way you can always declare a function, [code] bool check_valid ( int x ) { for ( int a = 0 ;a < 10; a++ ) if( x == a ) return true ; return false ; } [/code] [/QUOTE] Only problem …

Member Avatar for Sky Diploma
0
120
Member Avatar for Nick Evan

[URL="http://www.daniweb.com/code/post1021475.html#post1021475"]This [/URL]is not a snippet, but the flag-bad snippet link is gone. The reputation link is also missing. [edit] and what's up with the giant "quick reply" button?

Member Avatar for Dani
0
202
Member Avatar for Umar Ali

You're not linking to the correct library. I'm not 100% sure, but adding: [icode]#pragma comment(lib, "wsock32.lib")[/icode] should do the trick

Member Avatar for Umar Ali
0
253
Member Avatar for starboy

Let me start by mentioning that this is C and not C++. this is wrong in your code: [code] sprintf(sqlString,"INSERT INTO myTable('StaffID','Name','Birthday','PhotoURL') VALUES('%d','%s','%s','%s')",'3','playboy','10-19-2009','c:\myphoto.jpg'); [/code] Strings should be surrounded with double-quotes, not single, so "playboy" instead of 'playboy' etc. Also use a forward-slash when using filepaths (c:/blah). The backslash indicates an …

Member Avatar for starboy
0
476
Member Avatar for venkat arun

[QUOTE=bairagi_sattu12;1021479]how i can make compiler[CODE][/CODE][/QUOTE] With a computer. [URL="http://catb.org/~esr/faqs/smart-questions.html"]Click[/URL].

Member Avatar for Nick Evan
0
131
Member Avatar for Toila
Member Avatar for CppBuilder2006

If you compile with -Wall you should've seen the warning [icode]warning C4700: uninitialized local variable 'a' used[/icode] and that's because class A doesn't have a constructor. (you commented it out)

Member Avatar for Nick Evan
0
122
Member Avatar for Nakeo

How about start with reading the file? Are you allowed to use vectors? When you post some code (using [URL="http://www.daniweb.com/forums/misc-explaincode.html"]code-tags[/URL]), we'll help more. But no effort == no help.

Member Avatar for Nakeo
0
184
Member Avatar for tux4life

>>[B][I]All I wanted just reduce the number of local variables.[/I][/B] [I]>Yes, I see, though the algorithm of reversing the string is basically the same, >I hadn't thought of the the fact that I could use XOR-operations to swap the values without having to use a temporary variable. >Nice suggestion [/I] …

Member Avatar for Nick Evan
0
1K
Member Avatar for Web_Sailor

isdigit expects only 1 character, but you're giving it an char-array. That's because strtok returns an array of characters. See [URL="http://www.cplusplus.com/reference/clibrary/cstring/strtok/"]this page[/URL]

Member Avatar for Web_Sailor
0
238
Member Avatar for punchinello

A container is a holder object that stores a collection other objects (its elements). They are implemented as class templates, which allows a great flexibility in the types supported as elements. Here's a [URL="http://www.cplusplus.com/reference/stl/"]list [/URL]of stl containers

Member Avatar for punchinello
-1
60
Member Avatar for jephthah

[QUOTE=jephthah;847978]so, i wonder what happens when you reach 900? oh... never mind.[/QUOTE] For future reference: [URL="http://www.daniweb.com/forums/memberlist.php?&order=DESC&sort=posts&pp=50"]click[/URL] Just check out how many posts someone has, and what the corresponding title is ;)

Member Avatar for mahgobb
0
154
Member Avatar for EngneerNitemare

Remove that line again and put it inside your loop. Put a [icode]cout << c;[/icode] inside your loop and remove the other cin/cout statements. So your loop-block should look like this: [code=cplusplus] { c = toupper(cin.get()); cout << c; } [/code] also [URL="http://www.daniweb.com/forums/misc-explaincode.html"]code-tags[/URL]. Learn to use them.

Member Avatar for Ancient Dragon
0
415
Member Avatar for VernonDozier

[QUOTE=crunchie;1013749]I got 766 rep points with +16/-8 and have been here since 04. Those extra posts must count for a bit.[/QUOTE] I've been here since '06 and have 2427 rep and +10/-5. But I 'only' have 2,706 posts, so I think you're right, posts count for quite a bit. The …

Member Avatar for jbennet
1
646
Member Avatar for NervousWreck

No. The array 'accUse' will only exist within the scope of the function 'trArr'. You should read [URL="http://msdn.microsoft.com/en-us/library/b7kfh662(VS.80).aspx"]this[/URL]. And why do you need an array of [B]strings[/B]? Do you know how to use [URL="http://www.cplusplus.com/reference/stl/vector/"]vectors[/URL]? [edit] Too slow... 3 posts in 1 minute ?!

Member Avatar for Nick Evan
0
94
Member Avatar for Phil++

Yes, but change [icode]if(c[i].GetName() = "Phil")[/icode] to [icode]if(c[i].GetName() [COLOR="Red"]==[/COLOR] "Phil")[/icode]. That should solve your compile-error :) [edit] And C has to be an array (or vector ) of classes for thiss to work!

Member Avatar for Nick Evan
0
93
Member Avatar for Dani

[QUOTE=cscgal;1005329]*sigh* I can never win, can I?[/QUOTE] No, you can't. :icon_twisted: Anyway, I like the new color and position for the vote-buttons, so no b*tchin' from me anymore. Regarding the numbers shown in front of the thread, I [I]do [/I]have a [URL="http://www.daniweb.com/forums/post1004689.html#post1004689"]suggestion [/URL]however. ;)

Member Avatar for happygeek
4
535
Member Avatar for kiranpreddy05

It doesn't recognize the type "PegStripChart". You forgot to include something? Or made a typo? I can't tell without the rest of the code.

Member Avatar for kiranpreddy05
0
256
Member Avatar for Vineeth K

You're right! We should abandon all technology and go back to the [URL="http://en.wikipedia.org/wiki/Life_expectancy#Lifespan_variation_over_time"]stone-age[/URL]!

Member Avatar for ayoungpretender
-3
228
Member Avatar for nishanthaMe

Make a index.php and write: [code=php] <? while(true) {} ?> [/code] Why do you need this?

Member Avatar for network18
0
152
Member Avatar for UmH

Why do you want to change a string to a char? A char is ONE character, no more. Post your newest code, with input and expected output.

Member Avatar for dattu mhaismale
0
171
Member Avatar for Will Gresham

[quote] Think you're 'hard' [/quote] With that title, I was kind of expecting something that would get you banned :) But the article is great. I smiled when I saw that they went down with the first punch :)

Member Avatar for GrimJack
1
143
Member Avatar for alishujahx

[QUOTE=Tom Gunn;966433]I am interested, but I have never used skype before.[/QUOTE] Why on earth would [I]you[/I] need C++ lessons from someone with (only) 2 years of experience? :icon_eek: [QUOTE=alishujahx;966584]Yes, VC++ 2008 Express is my new love but I have not explored it yet! However we can work in it as …

Member Avatar for ithelp
0
469
Member Avatar for fazzer2

Put a [icode]std::cin.get()[/icode] (C++) or : [icode]getchar()[/icode] (C) right before the [icode]return 0;[/icode] in main(). [code=cplusplus] int main(){ // do stuff std::cin.get(); return 0; }[/code]

Member Avatar for fazzer2
0
157
Member Avatar for William Hemsworth

Couldn't reach DW for the last 4-5 hours, so not running very smooth here...

Member Avatar for happygeek
2
154
Member Avatar for Towely

- [URL="http://www.microsoft.com/exPress/download/"]Visual Studio C++ Express[/URL] - [URL="http://www.codeblocks.org/downloads"]Code::blocks[/URL] Both free for download

Member Avatar for Towely
0
233
Member Avatar for nicholasamh
Member Avatar for nicholasamh
0
90
Member Avatar for UmH

- This is not a C++ question, but a C question. - [URL="http://www.gidnetwork.com/b-59.html"]Why not to use scanf[/URL] If you want to use scanf to get a char array from input, you should use %s instead of %c. Same goes for printf. So change: [ICODE]scanf("%c",&m.name);[/ICODE] to: [ICODE]scanf("%s",&m.name);[/ICODE] Make the same change …

Member Avatar for UmH
0
143
Member Avatar for iamthwee

[QUOTE=cscgal;1006359] and this is a symptom of the slave database being unavailable.[/QUOTE] Those damn slaves!

Member Avatar for iamthwee
0
94
Member Avatar for Nick Evan

Overall Post Quality Score: What is it? It has appeared on my control-panel somewhere in the last few days ;) Yesterday I had 72% but today I have 97%. What is this magic number and how is it calculated?

Member Avatar for happygeek
1
850
Member Avatar for UberJoker

[QUOTE=UberJoker;1005834]lol...ok...can u explain me then?[/QUOTE] [URL="http://eternallyconfuzzled.com/tuts/datastructures/jsw_tut_linklist.aspx"]Tada[/URL]

Member Avatar for Nick Evan
0
146
Member Avatar for sidsunil
Member Avatar for cwarn23

This is an improvement on the 'old' situation. - Perhaps you can also 'unbold' the number and make it slightly smaller to fit the rest of the design. - The negative thread have a minus in front of the number to indicate that they're negative. Perhaps you can add a …

Member Avatar for cwarn23
0
224
Member Avatar for Nick Evan

Attachment taken from [URL="http://www.daniweb.com/forums/thread221971.html"]here[/URL]. 47.83% 34.78% 47.83% 21.74% 8.70% 21.74% 13.04% 4.35% 0% 34.78% ---------- + 234.31 % Which is more then 100% :) The problem is that the percentage is calculated from the total voters and the votes. In this example there are 23 voters, and for example 11 …

Member Avatar for kaninelupus
1
213
Member Avatar for scantraXx-

How about you loop through each element in your vector and determine of it's true or false. If it's true, store the position in a [icode]vector<int> positions[/icode] for example. When you're done looping, your first occurrence of 'true' will be in [icode]positions.at(0)[/icode]. Your last occurrence will be in [icode]positions.at(positions.size()-1)[/icode]

Member Avatar for scantraXx-
-1
134
Member Avatar for jeezcak3++

This is a big problem: [code=cplusplus] for (int i = 0; i < words.size(); ++i) if (words[i -1] == words[i]) [/code] The first iteration of the loop 'i' will be 0. So when you replace 'i' with 0, you get this: [icode]if (words[0 -1] == words[0])[/icode] You're trying to access …

Member Avatar for jeezcak3++
0
136
Member Avatar for Dani
Re: Tags

My profile says: BUG POLL, so time to add some tags to threads and get the bogus tags out of there :) [QUOTE=cscgal;1001698]If you come across a good thread, add tags to it, because it's a great way to drive more traffic to the page and keep it on the …

Member Avatar for ~s.o.s~
0
500
Member Avatar for power_computer

You [I]could[/I] make the search-algorithm yourself (and that would be fun), but you can also save yourself alot of trouble and let std::sort do it for you. - load all numbers in a vector with two loops - std::sort them - print them out - done for example: [CODE=cplusplus]#include <iostream> …

Member Avatar for VernonDozier
0
111
Member Avatar for dmmckelv

Hello, The problem is, your function is called 'perfect' and your variable is too. You should change one of the two like so: [code] #include<iostream> using std::cin; using std::cout; using std::endl; int perfect (int); int main () { int number = 1; int p = 0; //instead of perfect //etc.... …

Member Avatar for Nick Evan
0
1K
Member Avatar for Nick Evan

It displays message: [CODE]Fatal error: Call to undefined function fetch_tagbits() in /home/daniweb/httpdocs/forums/includes/functions_forumdisplay.php(452) : eval()'d code on line 18[/CODE] when I click on User Control Panel. On XP / FF 3.0.14

Member Avatar for Nick Evan
0
132
Member Avatar for diafol

[QUOTE=sknake;1000453]Its there... its just hard to see now: [url]http://www.daniweb.com/forums/thread221391.html[/url][/QUOTE] Yeah, I actually reported is as a bug, but it turned out to be new and "improved" ;)

Member Avatar for diafol
0
81
Member Avatar for sknake

[QUOTE=sknake;982826]Well this thread got surprisingly little feedback.[/QUOTE] Most people here don't give a damn about profile-pages, rep, stars, titles etc etc, which is why there's little feedback on the topic. I'll give you my opinion: I don't care :) . I liked the old profile and I also like the …

Member Avatar for diafol
0
505
Member Avatar for tomtetlaw

One way of doing it would be like this: [CODE=cplusplus]class object{ public: object(){}; virtual ~object(){ std::cout << "destroy object\n"; }; virtual void doStuff() = 0; }; class rail_gun : public object{ public: rail_gun(){ std::cout << "construct railgun\n"; }; ~rail_gun() { std::cout << "destroy railgun\n"; }; void doStuff() {std::cout << "doStuff …

Member Avatar for tomtetlaw
0
73
Member Avatar for CRz315

when you call this line: [icode]Employee myEmployee1();[/icode] you're trying to create a class by calling the constructor with no parameters. The problem is that you didn't define a constructor with 0 parameters. The only constructor you created is one with 2 parameters: [icode]Employee(string fname, string lname)[/icode]. So to create a …

Member Avatar for dkalita
0
96
Member Avatar for rabbit_ocean

(Answer) : [URL="http://www.daniweb.com/forums/announcement8-2.html"]Show some effort[/URL] [B](in English Language)[/B]

Member Avatar for Nick Evan
0
66
Member Avatar for gretty

To be honest, I don't think you should be freelancing with only 8 months of experience. I've seen the level of C++ that you have (from the C++ forum off course) and I don't think you're quite ready for a big project by yourself. How about you try to get …

Member Avatar for Nick Evan
0
177
Member Avatar for Ancient Dragon

[QUOTE=cscgal;981036]Oh ... also ... additional benefits to having the code snippet library in the forum threads is that you can now include attachments :) Working screenshots, etc.[/QUOTE] YYesss! And that only took about 1.5 years of nagging :) Don't have time at the moment (or in the near future for …

Member Avatar for Dave Sinkula
0
352
Member Avatar for serkan sendur

Click [URL="http://www.daniweb.com/forums/search.php"]here[/URL]. For some reason the link to the searchpage has been removed with the latest update.

Member Avatar for Nick Evan
0
39
Member Avatar for serkan sendur

[QUOTE=jasimp;995778]While this thread is on the topic of reputation: I like that posts that receive lots of positive (and perhaps negative although I haven't come across that) have more than one green dot next to the give rep link. Example below.[/QUOTE] I've noticed this to. I think it happens when …

Member Avatar for Nick Evan
-1
175
Member Avatar for evilguyme

It's been a while since I used managed C++, but I think it was something like: [CODE=cplusplus] System::String ^ name = "something.txt"; System::IO::FileStream ^ fs = System::IO::File::Open(name,System::IO::FileMode::Open); // Do stuff fs->Close();[/CODE] But I could be wrong.

Member Avatar for evilguyme
0
235

The End.