2,839 Posted Topics
Re: [QUOTE=paolomontero;620824] It's just a function that takes a string as an argument and merely loops till it finds the terminating NULL character. [...] Am i doing something wrong? [/QUOTE] Yes. To find the terminating char, you did this: [icode]while (s[n] != 0) [/icode] But 0 and the string-terminating-char aren't the … | |
Re: [QUOTE=Alex Edwards;624901][code=c++] char FilePath[] = "C:\\Dev-Cpp\\keylogger.exe"; [/code] I think your problem is here, where you use \\ instead of // for your file path checking. [/QUOTE] Nope. That's perfectly fine. The first backslash is used as an escape-character to indicate that the second backslash isn't an escape-character :) [URL="http://www.gillius.org/ctut/app_a.htm"]Link [/URL] | |
Re: [QUOTE=cam9856;623785]Is this possible to do [CODE]if (location == "Amasi Village") AmasiVillage(); if (location == "Reya") Reya();[/CODE][/QUOTE] Yes it is, if you included <string> and it's a std::string. Did you change the thing that Ancient Dragon told you? If yes: please post you new code | |
Re: [QUOTE=joshmo;625109]Correct me if am wrong [/QUOTE] You're wrong :) It doesn't matter what you put behind the ifndef and define, as long as it's the same: [code] #ifndef whocares #define whocares //do stuff #endif [/code] at [B]SwathiSangral[/B]: I see what the problem is. Very interesting... I would swear that this … | |
Re: [QUOTE=AnjaliAnuradha;625030]Hi, I didnt get any errors while compiling the same program you sent. But I got a message - vector subscrpit out of range. Did I make any mistake? Please help me. [/QUOTE] Nope you didn't. But Ancient Dragon had a small error in his example. This line: [ICODE]for(size_t i … | |
Re: 1. To check if the number is odd or even, you could use the modules (%) operator. To enter 10 numbers, you could use a loop. 2. Are you allowed to use [URL="http://www.cppreference.com/cppvector/index.html"]vectors[/URL]? 3. Basic file-access. Look into [URL="http://www.cplusplus.com/reference/iostream/ifstream/"]ifstream[/URL] Now try to make something yourself. Don't try to make at … | |
Re: Here are some quotes from the [rulebook](http://www.daniweb.com/forums/faq.php?faq=daniweb_policies): > Do not post homework problems expecting a quick answer without showing any effort yourself. This especially pertains to the software development forums. For easy readability, always wrap programming code within posts in code blocks and inline code tags. And : > Do … | |
Re: [QUOTE=auzzyboy;621747]My idea is really simple: I would like some help with People experianced in C or C++. to script. [/QUOTE] C++ and [i]script[/i]?? You haven't got a clue what you're talking about right? Is this some sort of homework assignment? Don't post your email address here and say "gimme da … | |
Re: Daniweb has an excellent search function for this. [URL="http://www.daniweb.com/search/search.php?q=final+project+vb"]Click[/URL] | |
Re: Don't hate me for saying this but: Did you connect the speakers correctly? It should be the green connector... Are you sure your speaker work? If not, try you headphone and see if it works. Do you have all the volumelevels open in windowsmixer? regards Niek | |
![]() | Re: could you post the demo-app which causes this error? If I had to guess the demo is writing somewhere where it shouldn't be writing. There are very few (actually none that I know of) errors in STL :) |
Re: Ok. Where's the camera? Or am I just going insane? This is yet again the exact same code as [url]http://www.daniweb.com/forums/thread128043.html[/url] [url]http://www.daniweb.com/forums/thread128037.html[/url] Are you three in the same class or something? Or are you all the same person? But to solve your problem, put this: [icode] strcpy_s(blank, solution);[/icode] right after [code]for … | |
Re: I recommend not to use system(). What is someone makes a program called 'mkdir' that formats your HD? That would be quite a bummer. Now for a solution: Linux[code]#include <sys/stat.h> mkdir (const char *path, mode_t mode);[/code]in this case mode = O_CREAT. Function returns an int (0 on success) Windows[code]#include <windows.h> … | |
Re: The above code won't compile. What is 'elem' ? a bool? And you missed a semicolon after cin.get() For other people who want to help: Here's the code from the header (it was discussed in another thread) [code=cpp] #include <iostream> using namespace std; template <class T> inline void PRINT_ELEMENTS (const … | |
Re: As I mentioned to you (ambarisha )[URL="http://www.daniweb.com/forums/post621982-4.html"] three days ago[/URL]... | |
Re: From [URL="http://www.daniweb.com/forums/thread90228.html"]this thread[/URL] by [b]Narue[/b] [quote] [code] #include <ios> #include <istream> #include <limits> void ignore_line ( std::istream& in ) { in.ignore ( std::numeric_limits<std::streamsize>::max(), '\n' ); } [/code] The ignore member function of std::istream will read and discard up to N characters or until a delimiter. In the above example, N … | |
Re: [URL="http://www.cplusplus.com/doc/tutorial/files.html"]click[/URL] | |
Re: @ fierykido : Congrats! You've just resurrected a 3 year old thread. If you want to discuss the topic, use the [URL="http://www.daniweb.com/forums/thread92901.html"]thread [/URL]that's still alive. @mod: Lock? | |
Re: line 30: [icode] else if( choice != 'y' || choice != 'Y' )[/icode]. That line will always return ' true'. Name me one input that won't :) Also you need to put line 31-36 in curlybrackets ( {} ). You should change it to : [code=cpp] if( choice == 'y' … | |
Re: [QUOTE=chrisfrolich;622027] but it doesn't seem to be working very well. [/quote] What isn't working very well? I tried the program and the only thing I found wrong is that it doesn't recognize it when you've solved the puzzle. That's because of this line: [icode]while (solution != blank)[/icode] You're comparing two … | |
Re: Could you show some code from the server part? Only the connecting bit for example? Also: what OS are you using? | |
Re: I'll give you t[URL="http://www.sgi.com/tech/stl/table_of_contents.html"]he same link[/URL] for the third time. Scroll down for logical operations...:yawn: (also said it [URL="http://www.daniweb.com/forums/thread127645.html"]here [/URL]and [URL="http://www.daniweb.com/forums/post621387-6.html"]here[/URL]) | |
Re: [QUOTE=ambarisha.kn;623536]Hi, I want to replace the numbers which are less than 5 in a container. [...] [code] replace_if(V2.begin(),V2.end(), bind2nd(less<int>() ,5)); //replace criterion [/code][/QUOTE] Replace them with what? You're missing the last parameter for the replace_if() function. If you want to replace them with '1' for example, you should use [icode]replace_if(V2.begin(),V2.end(), … | |
Re: What do you mean by 'open'? View the file's contents? What type of file is it (text/ bin/ ...) | |
Re: Perhaps the people in the linux-forum can help you with this problem? | |
| |
Re: I thought long and hard about how to solve this problem. But after a while a decided to change Salem's searchstring ( "[ICODE]how to create a windows service[/ICODE]") to [ICODE]"how to create a windows service in c++"[/ICODE] I got this:[URL="http://clusty.com/search?input-form=clusty-simple&v%3Asources=webplus&query=how+to+create+a+windows+service+in+c%2B%2B"] http://clusty.com/search?input-form=clusty-simple&v%3Asources=webplus&query=how+to+create+a+windows+service+in+c%2B%2B[/URL] A lot of interesting search results. Damn. That was … | |
Re: [QUOTE=zoner7;621213]My suspicion is that, in the below code, the continue statements effectively does nothing and put my code right before the return false statements. [/QUOTE] Correct :) [QUOTE=zoner7;621213] I am curious if anyone has ideas about how to rewrite this code to make it work properly. [/quote] I would like … | |
Re: [QUOTE=joshmo;621832]ithen do something like "/n" so that your data is written to the next line[/QUOTE] Actually it's '\n' (with a backslash) Typo I guess? ;) | |
Re: You can't just cast an image into a char array. Besides: Microsoft has given us a lot of functions to play with: [code=cpp] Bitmap^ binaryImage=gcnew System::Drawing::Bitmap(bmpInputImage); Color pixelColor = binaryImage->GetPixel( 1, 1 ); //get pixel x=1 y=1 Byte g = pixelColor.G; Byte b = pixelColor.B; Byte r = pixelColor.R; Byte … | |
Re: You stole the code directly from [URL="http://www.daniweb.com/forums/thread128037.html"]this thread[/URL] :yawn: [QUOTE=computers08;622060]I need to make a handman game[/quote] A [i]handman[/i]? That's sounds a bit.. ehm.. :) [edit] On second thought: To solve your problem, put this: [icode] strcpy_s(blank, solution);[/icode] right after [code]for (counter = 0; counter < puzzLength; counter++) { solution[counter] = … | |
Re: You forgot to [icode] #include <numeric> [/icode] | |
Re: [QUOTE=herrepeder;621946]Hi, I am using Visual Studio 2008 with .NET, on Windows XP. Does anyone know how to (in C++): *Recieve a trigger signal(1bit) from an external device, ie throught a generic microphone input(jack)[/QUOTE] Here's a [URL="http://www.techmind.org/wave/"]link[/URL] on microphone input in Windows. But for a 1 bit input I would suggest … | |
Re: this code: [code] char EventString[27] = {"5012 444418E130010020<DC4>"}; EventString[26] = 0x0d; // * EventString[27] = 0x0a; // *[/code] Is wrong. You can't write data to the element 27 of your array. You declared your array to have 27 elements, which is EventString[0]-EventString[26]. So the text can only occupy element 0-25 … | |
Re: Let me guess: This came out of: The C++ Standard Library - A Tutorial and Reference? if yes: create a file "print.hpp" and wack this code in it: [code=cpp] #include <iostream> template <class T> inline void print_elements (const T& coll, const char* optcstr="") { typename T::const_iterator pos; std::cout << optcstr; … | |
Re: [QUOTE=RiddlerLG;616446] What i need help with:-Which type of programming i should start off(c, c++, etc.)[/quote] That's a subject of eternal debate. It would help if you would tell what exactly do you want to create. Like web-apps, OS, games, something else.. [QUOTE=RiddlerLG;616446] -website/ the forum community that will help me … | |
Re: You can't store names in an int-array. Int is for numbers only. You should use strings. Here's a sample program that takes in 7 names and shows them. [code=cpp] #include <iostream> #include <string> using namespace std; int main() { const int size = 7; string names[size]; //get seven names for … | |
Re: You're missing one closing bracket in your header file (plot.h). Change it to : [code=cpp] [....rest of code] return 2*Width()+2*Height(); } //<----- ADD THIS ONE }; [/code] And it should compile. These kind of errors can easily be avoided if you [URL="http://en.wikipedia.org/wiki/Indent_style"]indent [/URL]your code. I personally like the K&R style, … | |
Re: [URL="http://www.codeproject.com/KB/cpp/mfc_architecture.aspx"]Win32 vs MFC[/URL] I really like [URL="http://www.functionx.com/visualc/"]this [/URL]tutorial on MFC. Just start with the intro. | |
Re: So what problems do you have? Does it compile? If yes: What output are you getting, and what ouput are you expecting? Next time you post code, please use [noparse] [code=cpp][/noparse] [icode] //your code here [/icode] [noparse] [/code] [/noparse] [URL="http://www.daniweb.com/forums/misc-explaincode.html"]code tags[/URL] And what's wrong with you keyboard? Where I come … | |
Re: [quote]Void function does not return the value[/quote] Correct, that's what a void function does. If you want a function to return a value, you shouldn't make it void. example: [code=cpp] int timestwo(int in) { return in*2; } int main () { int orig = 4; int k = timestwo(orig); cout … | |
Re: And you aren't printing regionArray like this :[icode]cout << regionArray;[/icode] right? Because it would only print the address of the first element of the array. you should use [icode]cout << regionArray[0];[/icode] | |
Re: [QUOTE=Radical Edward;620526] [code] [...] while ((ch = getch()) != '\r') { [..] [/code][/QUOTE] Why use getch() when there's a standard function: getchar()? Without getch() you can also lose: [icode]#include <conio.h>[/icode] I know Edward's coding skills and I guess getch() got there by mistake? | |
Re: Something like: [code=cpp] Form2 *second_form = new Form2; second_form->Show(); [/code] Change "Form2" to the name of your second form. | |
Re: Here's a [URL="http://www.sgi.com/tech/stl/table_of_contents.html"]link [/URL]for STL with example codes just scroll down for arithmetic and relational operations. | |
Re: [QUOTE=williamhemswort;616769]I think you need to disable unicode to remove those errors. Try adding: [CODE]#undef UNICODE[/CODE] at the very beginning of your source code.[/QUOTE] You're right, but if the OP [i]wants[/i] to use unicode (no idea why, but: ) You could call [icode]CreateProcess[/icode] like this: [icode] CreateProcess(L"yourexe.exe", L"parameters", ....etc); [/icode] | |
Re: [QUOTE=begueradj;615826]I will try to code it for you in the following days and i will post it on your thread hopefully. Begueradj.[/QUOTE] You [i]do[/i] realize that the question was asked 1,5 years ago right? | |
Re: Do you have any programming skills? If no: you should learn some. I personally recommend C++, but other people disagree and say Java or even VB is the way to go. If you do know how to program, you could start by reading this [URL="http://www.daniweb.com/forums/thread63827.html"]thread[/URL]. It has a lot of … | |
Re: [QUOTE=majestic0110;615588] Of course, the book is much better than the film -which itself is not a [I]bad[/I] movie. [/QUOTE] Same goes for Minority Report. The book was also from Philip K. Dick and it's plot is a lot better then Tom Cruise playing with wooden balls. Philip K Dick and … | |
Re: Every time you call the [icode] Random_Number()[/icode] function, you're re-seeding rand(): [icode] srand((unsigned)time(0));[/icode]. You should only seed once per program. So move that line to the first line in main() and remove it from the function: [code=cpp] int Random_Number() { int random_integer = (rand()%9)+1; return random_integer; } [/code] I suspect … |
The End.