2,839 Posted Topics
Re: This is the third time I'm going to tell you to : [URL="http://www.daniweb.com/forums/announcement8-3.html"]PLEASE USE CODE tags[/URL] You need a loop around the two DeviceIoControl() lines like : [icode]while(1){ DeviceIoControl things }[/icode] [icode]DWORD d = 0;[/icode] This line is useless | |
I have a problem with session in combination with DNS. I use have a webpage where some areas are restricted. So I use a log-in screen which sets the session username and writes the sessionid in a DB. When you try to access a restricted page, a script checks if … | |
Re: [QUOTE]I can use this "if (something != null)"[/QUOTE] You could, because NULL (all caps) is defined (on all systems I've ever worked on) as 0 which is an int. (#define NULL 0) | |
Re: [URL="http://www.daniweb.com/search/google.php?domains=www.daniweb.com&q=parking+change&sitesearch=www.daniweb.com&client=pub-8426641637123945&forid=1&ie=UTF-8&oe=UTF-8&flav=000000&sig=Au_QpLTb4IAmuMq6&cof=GALT%3A%23008000%3BGL%3A1%3BDIV%3A%23BBBBBB%3BVLC%3A0033CC%3BAH%3Acenter%3BBGC%3AFFFFFF%3BLBGC%3AFFFFFF%3BALC%3A0033CC%3BLC%3A0033CC%3BT%3A444444%3BGFNT%3A0033CC%3BGIMP%3A0033CC%3BFORID%3A11&hl=en"]search [/URL]for parking charge | |
Re: [QUOTE=cosmos22;538477]I see, do I then replace pFileToDelete with something like pTextdocument.txt? [/quote] With something like: "c:\\mydirectory\\myfile.txt" (please note the double backslashes and double quotes) [QUOTE=cosmos22;538477] Unfortunetly, I compiled this, and it highlighted this area: cout << "Error: exactly one program argument accepted." << endl; [/QUOTE] replace it with: [ICODE]std::cout << … | |
Re: [quote] struct RationalNo { RatNo [20]; }[/QUOTE] What is a RatNo? You should give it a type like 'int': [CODE=c]struct RationalNo { int RatNo [20]; };[/CODE] Please note that I've added a semicolon next to the curly bracket. All struct-definitions require that. Now the structure has a member that is … | |
Re: Just remove the '\n' in the cout string: [icode]cout << "10 appears " << mycount << " times.\n"[/icode] =becomes=> [icode]cout << "10 appears " << mycount << " times."[/icode] new output: [icode]10 appears 3 times. 20 appears 3 times.[/icode] | |
Re: [quote=jbennet] I use wxwidgets on windows works well [/quote] That's what I like about it to. It even works on MAC, no need to change the code. [quote=shrutijadhav] Qt supports C++.right? if it supports C also plz let me know. [/quote] If it supports C++ it supports C. Niek | |
Re: That's not so hard.. Have you tried anything yet? Have you learned about functions? Example: [code=c] int Substract(int x, int y) { //do something with x and y return answer; }[/code] Niek | |
Re: Where's the question in this code? Before you post again please read [URL="http://www.daniweb.com/forums/thread93280.html"]this [/URL]about code tags and [URL="http://www.daniweb.com/forums/thread78223.html"]this [/URL]about asking clear questions, meaningfull titles . Niek | |
Re: [code] cd \ dir /s [/code] :) How do you want the files? Name only or with path. What os are you using? | |
Re: It may not be a good idea to post the password from your database in a public forum. I'll ask a mod to remove it. [code=php] $industype=$_REQUEST['industype']; $careerlevel=$_REQUEST['careerlevel']; [/code] The one thing I can think of is that the above statemants failes. Could you check if $industype & $carreerlevel get … | |
Re: [QUOTE=joshSCH;534482]I think it would be a good idea to further explain reputation to new members. [/QUOTE] I think most new members couldn't care less about Rep. They come here, want an answer to their problem (pleaze helpz mee!!!!11 lol!) and disappear. The people who DO stick with the site can … | |
Re: You're very right: [URL="http://www.cplusplus.com/reference/clibrary/cstdlib/rand.html"]rand[/URL]() so for number between 1-500 use: [icode]value= (rand() % 500) +1;[/icode] All credits for Invisal! [QUOTE=ithelp;535206]% operator removes randomness quite a bit.[/QUOTE] Oh? Niek | |
Re: Add this to your code (just before return 0): [code=c] std::cin.ignore(); std::cin.get(); [/code] The first line discards the '\n' that's still on the stream. The second keeps your window open. | |
Re: You migth want to download the [URL="http://sourceforge.net/forum/forum.php?forum_id=631708"]OpenCV [/URL]lib. It has some nice samples/tutorials and it is very easy to display an image with OpenCV. No need for windows libraries. Niek | |
Re: First: Look if you have the file somewhere on your computer (just use search function from windows). Next: go to project->properties Select from the list configuration properties->linker->general in the additional dependencies box, add the dir you've just found Niek | |
Re: [QUOTE]("insert into songs values (%Q ,%d, %d, %Q, %Q, %Q, ... ", someInt, someChar, someChar... )[/QUOTE] Do you use someting like sprintf_s()? (or sprintf()) example: [code=c] char c = 'x'; int i = 123; char buffer[1024]; sprintf(buffer, "Test number: %d, test char, %c", i,c); [/code] | |
Re: [QUOTE]How to arrange the number properly?[/QUOTE] Congrats: Taking this and other threads into account, you've just scored an A+ in "The art of asking vague questions"! Perhaps you mean sorting a list a numbers? If so:[URL="http://en.wikipedia.org/wiki/Bubble_sort"]bubblesort[/URL] | |
Re: [URL="http://linux.about.com/od/commands/l/blcmdl2_fork.htm"]fork[/URL] [URL="http://linux.about.com/od/commands/l/blcmdln_exec.htm"]exec[/URL] Pid = a Process ID. It's just a number unique to 1 process. PPID is it's parent. Next time if you have a question please read the [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]rules[/URL]. This thread was a year old, so ask your questions in a new one please. Niek | |
Re: When you have all the input, just check if one of them is smaller then 0 and print a error message: [code] if (tacos < 0 || hotdogs < 0 || [etc...] ) { cout << "Error message" << endl; return 0; } [/code] The || sign are two 'pipes' … | |
Re: I may be thinking to simple, but do you by any change have a new version of Winzip and your teacher doesn't? Or different Operating Systems? | |
Re: [QUOTE=c++noobie;532802]I tried that and recieved the following error [CODE]error: base operand of `->' has non-pointer tupe `addBook'[/CODE] [/QUOTE] With the code from Dave this error wouldn't come up.. Can you post your entire new code? Niek | |
Re: What work and doesn't work? What's the problem? One thing I see is: [icode]int t[(high-low)+1];[/icode] You can't declare array this way. high and low aren't const int. Niek | |
Re: I remember that Dani changed it because she wanted the people to come to the site for the answer. More people on daniweb == more money from ads Correct me if I'm wrong Niek | |
Re: Here's a page about [URL="http://www.cplusplus.com/reference/clibrary/cstdio/printf.html"]printf[/URL]() But you shouldn't use it with C++. Changing the text color can be done with: [URL="http://msdn2.microsoft.com/en-us/library/ms686047(VS.85).aspx"]SetConsoleTextAttribute[/URL]() This example: [code=c] SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE),1); cout<< "iets"; [/code] will make your text blue. Changing the '1' to other values will result in other colors. Don't forget to [icode]#include <windows.h>[/icode] … | |
Re: If you are required to use std::strings, I'll give you a hint: [code=cplusplus] #include <iostream> #include <string> using namespace std; int main() { string str = "abc"; cout << str[0] << endl; cin.get(); return 0; }[/code] Now if you combine this with a loop and .length, you should be able … | |
Re: There's a special function for this: [URL="http://www.cplusplus.com/reference/clibrary/cstdlib/atol.html"]atol[/URL]() Here's an example of how to use it: [code=c] #include <stdio.h> #include <stdlib.h> int main () { long li; char ch[] = "1100033884"; li = atol (ch); return 0; } [/code] Niek | |
Re: [QUOTE=rhish.franks;531987] getch(ans); /* or getche(ans); will also work */ [/quote] Is that so? I'll bet it gives a compiler error with VS2005. getchar() would be the standard alternative. Niek | |
Re: [QUOTE=number87;532062] gives me an error msg at line 21.... [/QUOTE] You've declared 'col' inside the inner for loop. That means that when the loop is done, col is outside of scope. To solve this problem you would have declare 'int col' in the same scope as where you use it. … | |
Re: >How can i enable the line numbers in my source code? Tools>Options>Text editor>C/C++ show line numbers. >2 If you have experience with dev, VS is not very different. What programs do you want to make? MFc/win32/console? Niek | |
Re: [QUOTE=deadrabit;529501] where str is an array of strings [/quote] Do you mean an array of strings or an array of chars = (sort of)string so : string str[x] or char str[x]? From w_char to string: [code=c] #include <sstream> [....] stringstream ss; ss << ffd.cFileName; string str; ss >> str; [/code] … | |
Re: What you first need to do, is to extract all the requirements from this text you've been given, to split the assignment in smaller problems: Problems: - Read a text file - remove all chars except for spaces and lowecase - find a function that reads a file line by … | |
Re: > `#define BIT(n) (1 << (n)) [b]//what does this do, I am unfamiliar with this call[/b]` Here's a [link](http://www.cprogramming.com/tutorial/bitwise_operators.html) about bitwise operators > start quote: // Delay function for (t1 = time; t1 > 0; --t1){ [b]//this will be the timer countdown[/b] for (t2 = 255; t2 > 0; --t2){ … | |
Re: [QUOTE=jowereya;526141]plz any one help me to solve this two proble befor 8/2/2008 [/QUOTE] I suppose a lot of people here could do that. But first you need to read [URL="http://www.daniweb.com/forums/announcement118-2.html"]this[/URL] . When you come back with some code or idea, you will get help. Niek | |
Re: [QUOTE=chandra.rajat;529432]what is coclass?[/QUOTE] [URL="http://msdn2.microsoft.com/en-us/library/aa366751(VS.85).aspx"]link[/URL] Niek | |
Re: Did some research for you, and there is a workaround : [code=c] #ifndef __stdio_h__ #include <stdio.h> #define __stdio_h__ #endif int vsscanf_s (const char * src, const size_t length, const char * format, va_list argList); int vsscanf_s (const char * src, const size_t length, const char * format, va_list argList) { … | |
Re: for uploading images : [URL="http://www.wellho.net/resources/ex.php4?item=h113/pic_up.php4"]http://www.wellho.net/resources/ex.php4?item=h113/pic_up.php4[/URL] for resizing jpegs you could use something like this: [code=php] <? $srcim = imagecreatefromjpeg("original.jpg"); list($width, $height, $value, $params) = GetImageSize("original.jpg"); $new_width=150; $factor = $width/$new_width; $new_height=$height/($width/$new_width); $dstim = ImageCreate($new_width, $new_height); $dstim = imagecreatetruecolor($new_width, $new_height); imagecopyresized($dstim, $srcim, 0, 0, 0, 0, $new_width, $new_height, $width, $height); imagejpeg($dstim); ?> … | |
Re: 1. C&C Yuri's Revenge 2. Quake I 3. Unreal Tournament 4. GTA I 5. Mario III Aaahh.. those were the days... | |
Re: If you're using a C-lib that supports [icode]strcpy_s()[/icode] (like microsoft) it's better to use it. It takes an extra parameter describing the size of the destination buffer and returns an error on overflow, where strcpy() would just cause a segmentationfault. Strcpy_s() isn't standard (yet?), so it may not be supported … | |
Re: [QUOTE=Kupitzc;528255] [code] list[i][j] = "*"; //I also tried using "*\0" to no avail. [/code] Any tips? [/QUOTE] When you are using char-arrays, you can't just asign a number of chars to it like you did with strings. Example: [icode] char test[20] = "This works"; [/icode] [code] char test[20]; test[20] = … | |
Re: When your program ends, windows automaticly closes the consolewindow. If you run it in CMD the window stays open because you opened it manually. Just add a [ICODE]getchar(); [/ICODE]or a [ICODE]cin.get()[/ICODE] to your code (the line before[ICODE] return 0; [/ICODE]) and the window should stay open. | |
Re: [QUOTE=atish00;527354][icode]corr[8]="pizzaboy"; error-- cannot convert char* to char[/icode][/quote] That obvious. You're trying to put 9 chars in 1 char, so the compiler gives you an error [QUOTE=atish00;527354][iCODE]corr[]="pizzaboy"; error-- char has zero values[/icode][/quote] True. Replace it with [ICODE]char corr[]="pizzaboy";[/ICODE] [QUOTE=atish00;527354][CODE=c] corr[0]="p" corr[1]="i" corr[2]="z" ----- syntax error [/quote][/code] If you asssign a single … | |
Re: > As strange as it might sound, it does exist: [MessageBox()](http://msdn2.microsoft.com/en-us/library/ms645505(VS.85).aspx") > As far as I know there's no way to input data in a MessageBox(). @OP: Are you creating a MFC-app or a win32? You could just open a new form with an "edit control" on it? | |
Re: Here's the compiler output from VS (is also free): Warning 1 warning C4003: not enough actual parameters for macro 'max' c:\Documents and Settings\Niekd\Mijn documenten\Visual Studio 2005\Projects\dani\dani\dani.cpp 17 Warning 2 warning C4003: not enough actual parameters for macro 'max' c:\Documents and Settings\Niekd\Mijn documenten\Visual Studio 2005\Projects\dani\dani\dani.cpp 90 Error 3 error C2589: '(' … | |
Re: at AD: That problem was already solved in [URL="http://www.daniweb.com/forums/thread107883.html"]this [/URL]thread. So I guess now both threads are solved ? | |
Re: Is the matrix a given size or can the user determine how big it can be? | |
Re: [QUOTE=jov0708;526185]iit did not compile correctly..[/QUOTE] What does the compiler say? What errors are there? I've just tried using FindFirstVolumeW in a MFC-app, but it works fine for me. | |
Re: Also: it's window[B]s[/B].h not window.h. A minor typo can cause a major headache. |
The End.