2,839 Posted Topics

Member Avatar for paolomontero

[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 …

Member Avatar for paolomontero
0
232
Member Avatar for pwnz32

[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]

Member Avatar for pwnz32
0
3K
Member Avatar for cam9856

[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

Member Avatar for cam9856
0
103
Member Avatar for SwathiSangral

[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 …

Member Avatar for Radical Edward
0
126
Member Avatar for AnjaliAnuradha

[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 …

Member Avatar for Nick Evan
0
134
Member Avatar for instructor_c

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 …

Member Avatar for Nick Evan
0
177
Member Avatar for sniper29

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 …

Member Avatar for jephthah
0
492
Member Avatar for auzzyboy

[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 …

Member Avatar for Tigran
0
106
Member Avatar for sana bangash

Daniweb has an excellent search function for this. [URL="http://www.daniweb.com/search/search.php?q=final+project+vb"]Click[/URL]

Member Avatar for hammerhead
0
124
Member Avatar for Its_me

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

Member Avatar for arasten
0
97
Member Avatar for Thew

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 :)

Member Avatar for Nick Evan
0
88
Member Avatar for timdog345

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 …

Member Avatar for joshmo
0
144
Member Avatar for Aamit

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> …

Member Avatar for Nick Evan
0
918
Member Avatar for ambarisha.kn

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 …

Member Avatar for ambarisha.kn
0
171
Member Avatar for ambarisha.kn

As I mentioned to you (ambarisha )[URL="http://www.daniweb.com/forums/post621982-4.html"] three days ago[/URL]...

Member Avatar for Nick Evan
0
155
Member Avatar for sfurlow2

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 …

Member Avatar for Nick Evan
0
115
Member Avatar for eranga262154
Member Avatar for eranga262154
0
321
Member Avatar for cancer10

@ 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?

Member Avatar for selfhelpebooks
0
928
Member Avatar for Black Magic

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' …

Member Avatar for Sky Diploma
0
110
Member Avatar for chrisfrolich

[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 …

Member Avatar for chrisfrolich
0
364
Member Avatar for Aamit

Could you show some code from the server part? Only the connecting bit for example? Also: what OS are you using?

Member Avatar for Ancient Dragon
0
138
Member Avatar for ambarisha.kn

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])

Member Avatar for ambarisha.kn
0
99
Member Avatar for ambarisha.kn

[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(), …

Member Avatar for ambarisha.kn
0
107
Member Avatar for camproject

What do you mean by 'open'? View the file's contents? What type of file is it (text/ bin/ ...)

Member Avatar for Nick Evan
0
330
Member Avatar for MKIII
Member Avatar for carobee
Member Avatar for Aamit

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 …

Member Avatar for mitrmkar
0
495
Member Avatar for zoner7

[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 …

Member Avatar for bugmenot
0
1K
Member Avatar for zoner7

[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? ;)

Member Avatar for zoner7
0
102
Member Avatar for &rea

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 …

Member Avatar for &rea
0
1K
Member Avatar for computers08

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] = …

Member Avatar for Salem
0
294
Member Avatar for ambarisha.kn
Member Avatar for herrepeder

[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 …

Member Avatar for herrepeder
0
258
Member Avatar for slacke

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 …

Member Avatar for Nick Evan
0
197
Member Avatar for ambarisha.kn

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; …

Member Avatar for ambarisha.kn
0
227
Member Avatar for RiddlerLG

[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 …

Member Avatar for KillerOfDN
0
103
Member Avatar for computers08

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 …

Member Avatar for computers08
0
92
Member Avatar for darkis

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, …

Member Avatar for Nick Evan
0
153
Member Avatar for kinger29

[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.

Member Avatar for Nick Evan
0
110
Member Avatar for fans3267

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 …

Member Avatar for Nick Evan
0
299
Member Avatar for Xokzin

[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 …

Member Avatar for Xokzin
0
335
Member Avatar for &rea

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]

Member Avatar for Duoas
0
169
Member Avatar for viperwarp

[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?

Member Avatar for Nick Evan
0
112
Member Avatar for Traicey

Something like: [code=cpp] Form2 *second_form = new Form2; second_form->Show(); [/code] Change "Form2" to the name of your second form.

Member Avatar for Traicey
0
63
Member Avatar for ambarisha.kn

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.

Member Avatar for mitrmkar
0
279
Member Avatar for asianguyjtran

[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]

Member Avatar for asianguyjtran
0
100
Member Avatar for myleila

[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?

Member Avatar for jephthah
0
185
Member Avatar for aidan mate

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 …

Member Avatar for CoolGamer48
0
131
Member Avatar for majestic0110

[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 …

Member Avatar for selfhelpebooks
0
280
Member Avatar for zoner7

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 …

Member Avatar for Duoas
0
178

The End.