2,839 Posted Topics
Re: strlen and char-arrays in C++? :icon_eek: Why not use the functions provided to us: [code] #include <iostream> #include <string> #include <algorithm> int main() { std::string str = "hello!"; std::cout << str << '\n'; std::reverse(str.begin(), str.end()); std::cout << str << '\n'; }[/code] Done :icon_smile: | |
Re: [URL="http://en.wikipedia.org/wiki/Bubble_sort"]Tada[/URL] | |
Re: This is slightly confusing. You say: [QUOTE=ImMoRtAl-;1051678] can any one give me the code to this?[/quote] But you also say: [QUOTE=ImMoRtAl-;1051678] im making a program a[/QUOTE] Why would you need the code, when you're making it yourself? And to make matters even more confusion, your signature says: [quote] Learn To … | |
Re: You need to change this line: [icode]cout << “ ‘s bonus is ” << bonus << endl; [/icode] to: [icode]cout << " bonus is " << bonus << endl; [/icode] without the fancy quotes, but with the plain old ones. also: What Firstperson said! | |
Re: This is the first post I've ever made that bumps a year old thread, but I thought it might be worth it ;) Happy birthday Dani! How was your day? | |
Re: You can select gcc/g++ to be your compiler for Code::blocks, yes. | |
Re: Does it show the [icode]cvNamedWindow[/icode] or close immediately? You could also try something like this (with cvCaptureFromAVI): [CODE]CvCapture* capture = cvCaptureFromAVI( "MGC_RC_ATV.avi" ); if( !capture ) { //fail } else { // work with the capture }[/CODE] | |
Re: [QUOTE=adatapost;1051067]Try it, [code] ..... case 'I': case 'i': if(roman.at(i+1)=='V' || roman.at(i+1)=='X') decimal-=1; else decimal += 1; .... [/code][/QUOTE] Problem with this code is that when 'i' reaches 'roman.length()', [icode]roman.at(i+1)[/icode] will be out of bounds. -> Crash @OP: have a look at [URL="http://www.daniweb.com/code/snippet227036.html"]this[/URL] | |
Re: [QUOTE=BestJewSinceJC;1050499]I actually PMed Dani with this same question a few weeks ago, but I received no response[/QUOTE] For some reason, she never reads them :icon_confused: I'll try to bring this thread under her attention however. | |
Re: [QUOTE=evstevemd;1049299] Although there may be other reasons, I think my major failure was how to setup things in those projects. And may how to combine things like .lib, .a, .dll (.so?) etc. [.....] that you expert (whatever level of expertness) help us to show step by step how to setup … | |
Re: What kind of 'bot'? I hope you're not talking about spam and/or viruses. That would make me very unhappy with you :icon_frown: | |
Re: I think you should reply to a thread if you feel that you have something valuable to add to it. That's how forums work. [I]But[/I] I can't see anything wrong with the 5th PM you got from Bob. I personally agree with him that a simple 'thanks' is worth more … | |
Re: [QUOTE=AndreRet;1049201]Try and re-post your problem as a NEW thread, you posted as a code snippet. I will then send you help.[/QUOTE] When you see posts like this in the future, just click the "flag bad post" link. This will send a notification to the moderating team and a moderator can … | |
Re: [QUOTE=vb5prgrmr;1049484]Thirdly, how can you call this thread anything to do with visual basic versions 4/5/6 when it contains .NET code???[/QUOTE] Moved to VB.net. | |
Re: [QUOTE=The Champ;1049648] What I was expecting was that L = [ 0, 2, 1 ] but the result was [ 2 , 1 , -1, -1 ] I would like to know why it is such. [/quote] You're using the pop() method of a list. It pop's a value from … | |
Re: [URL="http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html"]Beej [/URL]is your friend | |
Re: [QUOTE=silkyheart;1049875]umm... i have this school project... and i wanna make a game using c++... but i dont know how to do it... so please... any suggestions?[/QUOTE] It appears that your shift key is broken and your dot-key is stuck. You might want to consider buying a new keyboard. Here's a … | |
Re: [QUOTE=MosaicFuneral;1048045]I didn't see a single mod around, just an admin.[/QUOTE] Ahem. I'm working as fast as I can here, give me a break :) | |
Re: [QUOTE=gerard4143;1049269] And your analogy...Is that supposed to make sense...[/QUOTE] Works for me :) | |
Re: [QUOTE=donaldw;1048962] Is there a way to delete my own post?[/QUOTE] No there isn't, sorry. Think first, post later ;) I personally think your original post has some good advice in it and I don't understand why you removed it? Hint to OP: [URL="http://en.wikipedia.org/wiki/Lexical_analysis"]lexical analyzer[/URL] | |
Re: [QUOTE=~s.o.s~;955397]>I like the reputation system better I personally feel that the reputation system is a complete fail and the point system introduced by StackOverflow is awesome. [....] Let's assume that you post a really good answer to some C# question and it's a hit with the C# developers on this … | |
Re: Like this: FUNCTION.H: [CODE=c++] // Header guards, to ensure this file gets included only once: #ifndef FUNCTION_H_ #define FUNCTION_H_ // Function declaration void myFunction(void); #endif[/CODE] FUNCTION.CPP: [CODE=c++] // include the declaration #include "function.h" #include <iostream> // Function definition void myFunction() { std::cout << "myFunction called!"; } [/CODE] MAIN.CPP: [CODE=c++] // … | |
Re: Please. Just download code::blocks for linux. You don't want to use Turbo altogether, because it's outdated. [icode]sudo apt-get install codeblocks[/icode] or: [icode]sudo yum install codeblocks[/icode] | |
Re: Do you have sufficient privileges at your school to open sockets? | |
Re: Your comments in the code are spot on! Here's how to use the argument to open a file and display it's contents: [CODE=c++]#include <fstream> // for file-access #include <string> #include <iostream> using namespace std; int main(int argc, char* argv[]) { if (argc > 1) { cout << "argv[1] = " … | |
Re: [QUOTE=VernonDozier;1044568] I'm sure many people have written one[/QUOTE] Here's mine: [CODE=c++]#include <iostream> #include <algorithm> #include <string> #include <cctype> struct upper { int operator() ( int c ) { return toupper ( static_cast<unsigned char> ( c ) ); } }; struct lower{ int operator() ( int c ) { return tolower( … | |
Re: Hahaha, no. :) Check this out : [URL="http://en.wikipedia.org/wiki/Garbage_collection_(computer_science)"]garbage-collection[/URL] | |
Re: [QUOTE=hacker9801;642706]Well, lose the CString. [code=c++] System::String value = "RegNo"; System::String key = "Dept"; System::String /* assuming */ getValue = ReturnValue(value, key);[/code][/QUOTE] No. It wants a [noparse]System::String^[/noparse] (note the ^) But to solve the problem, you should use [noparse]std::strings[/noparse] [code=cpp] #include <string> ... std::string ReturnValue(std::string key,std::string value) { ....... ....... } … | |
Re: [QUOTE=Ancient Dragon;1022104][URL="http://www.break.com/index/drunkest-guy-ever-goes-for-more-beer.html"]video[/URL] of a drunk trying to buy some more beer.[/QUOTE] That's awesome. You have got to respect the pure will-power of this man. I mean, he's 99% unconscious, but he still keeps on trying to buy that 1 sixpack which is probably going to kill him. When I was … | |
Re: [QUOTE=cscgal;1042090]Therefore, my policy is to ensure 100% backwards compatibility [/QUOTE] You mean like with the [URL="http://www.daniweb.com/forums/post210781.html#post210781"]old smilies[/URL]? :icon_twisted: Or the fact that we first [I]had[/I] to use [noparse][code=cplusplus][/code][/noparse] tags because [noparse][code=cpp][/code][/noparse] was invalid [URL="http://www.daniweb.com/forums/post277698.html#post277698"]according to you[/URL], but now we [I]have[/I] to use [noparse][code=c++][/code][/noparse] tags because the [noparse][code=cplusplus][/code][/noparse] tags [URL="http://www.daniweb.com/forums/post984859.html#post984859"]are now … | |
Re: outp won't work in windows XP. You need inpout32.dll and then the _inp() and _out() functions. More about this and download [URL="http://logix4u.net/Legacy_Ports/Parallel_Port/Inpout32.dll_for_Windows_98/2000/NT/XP.html"]here[/URL] | |
Re: [QUOTE=Nyna;691524]thanks 4 the gr8 idea... i wud be happy if u cud help me out on this...[/QUOTE] Are you familiar with the word [URL="http://en.wikipedia.org/wiki/Sarcasm"]sarcasm[/URL]? We also have this huge "searchbox" on the right side of the screen, using it will give you a few ideas on a final year topic.... … | |
Re: Perhaps you should give some background on [i]why[/i] you need gaussian convolution. I mean: if you don't understand what is does, why do you think you need it? [QUOTE=something else;701255] So basically what i want to do is convolute a value with a function. [/QUOTE] Convolution is nothing but a … | |
Re: You forgot to use [noparse][noparse][/noparse][/noparse] tags. So all the tags posted by Dave were parsed, resulting in the crap above :) | |
Re: [URL="http://www.commodore16.com/index.php/component/content/article/47-games/67-punchy.html"]punchy[/URL] on my Commodore 16. (which I still own btw :) ) | |
Re: [QUOTE=nirav99;903809]Brainvommit code[/QUOTE] Here's a tip: read the [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]rulebook[/URL], especially the parts about code-tags and posting complete answers. And although you might think that your Turbo-C++ compiler is the best thing ever, in the real world it horribly outdated. You should really upgrade to some new compiler. [URL="http://siddhant3s.googlepages.com/how_to_tell_rusted_cpp.html"]Here [/URL]are some tips. … | |
Re: [QUOTE=trahrey;1023345] can anyone give me a hand?[/QUOTE] Sure: [attach]12268[/attach] Here's the C++ forum -> [URL="http://www.daniweb.com/forums/forum8.html"]CLICK[/URL] | |
Re: Aahh com on,,, plzz gimme the pseudocodez.... LOL111! :):(;) | |
Re: The simple answer is: [code=cplusplus] std::cout << "***\n***\n***\n"; [/code] and you'll have a square of stars. But you probably want to use loops. So what do you know about [URL="http://www.cprogramming.com/tutorial/lesson3.html"]loops [/URL]already? | |
Re: I second the motion. If I give a newbie -rep, he immediately has a rep-block as overall status. | |
Re: You probably need some sort of vision software. Just a lucky guess though :icon_wink: | |
Re: [QUOTE=Ryshad;1004746] But i can honetly say i find it hard to bring myself to continue helping if i am going to be down voted out of spite/ignorance...or (as the case was) because i am not willing to spoon feed them their entire project. :/[/QUOTE] Don't take it too serious. If … | |
Re: Also with B: this [icode]B = 3r + 12 + 10r + 20 = 102 //Distributive property[/icode] is completely wrong. I have no idea what you're trying to do here. Look, if r(B)=70/13=5.38... (according to you) then if you substitute 'r' with 5.38... in the original formula, you should get … | |
Re: [QUOTE=marco93;868651]This code is wrong (no recursive, no reparse points, etc) See the official MS sample (SDK)[/QUOTE] If you're going to call the code 'wrong', do you mind giving an example? To be honest Marco, your posts are getting a bit boring. You [i]always[/i] post something like: 'This sux, use win32 … | |
Re: Do it [URL="http://www.daniweb.com/forums/announcement8-2.html"]yourself[/URL]. | |
Re: I learned it from [URL="http://www.functionx.com/visualc/"]here [/URL] |
The End.