2,839 Posted Topics

Member Avatar for cosmos22

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

Member Avatar for Agni
0
240
Member Avatar for Nick Evan

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 …

Member Avatar for Nick Evan
0
130
Member Avatar for smiles

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

Member Avatar for VernonDozier
0
106
Member Avatar for jayohn

[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

Member Avatar for Nick Evan
0
109
Member Avatar for cosmos22

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

Member Avatar for cosmos22
0
186
Member Avatar for number87

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

Member Avatar for DangerDev
0
103
Member Avatar for aircraft

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]

Member Avatar for aircraft
0
99
Member Avatar for shrutijadhav

[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

Member Avatar for Duoas
0
154
Member Avatar for Just a beginner

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

Member Avatar for John A
0
92
Member Avatar for gmerch80

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

Member Avatar for Ancient Dragon
0
101
Member Avatar for gsivaram

[code] cd \ dir /s [/code] :) How do you want the files? Name only or with path. What os are you using?

Member Avatar for DangerDev
0
147
Member Avatar for lydia21

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 …

Member Avatar for lydia21
0
85
Member Avatar for joshSCH

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

Member Avatar for nav33n
-1
165
Member Avatar for buddyrocks73

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

Member Avatar for Narue
0
142
Member Avatar for jb7643

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.

Member Avatar for jb7643
0
94
Member Avatar for kedi

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

Member Avatar for Nick Evan
0
288
Member Avatar for jov0708

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

Member Avatar for Nick Evan
0
153
Member Avatar for linux0id

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

Member Avatar for linux0id
0
13K
Member Avatar for nurulshidanoni

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

Member Avatar for WaltP
0
114
Member Avatar for jaepi

[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

Member Avatar for Nick Evan
0
323
Member Avatar for jimJohnson

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

Member Avatar for jimJohnson
0
150
Member Avatar for evilseed187

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?

Member Avatar for Nick Evan
0
94
Member Avatar for c++noobie

[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

Member Avatar for Dave Sinkula
0
2K
Member Avatar for sanzle

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

Member Avatar for zhelih
0
144
Member Avatar for coolsaint

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

Member Avatar for jbennet
0
64
Member Avatar for atish00

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

Member Avatar for Nick Evan
0
115
Member Avatar for Marijan

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 …

Member Avatar for Marijan
0
260
Member Avatar for jov0708

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

Member Avatar for TimeFractal
0
2K
Member Avatar for newport

[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

Member Avatar for rhish.franks
0
198
Member Avatar for number87

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

Member Avatar for Nick Evan
0
136
Member Avatar for arunpawar

>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

Member Avatar for Ancient Dragon
0
158
Member Avatar for rickarro
Member Avatar for deadrabit

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

Member Avatar for Nick Evan
0
211
Member Avatar for look@me

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 …

Member Avatar for ithelp
0
341
Member Avatar for Student1

> `#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){ …

Member Avatar for Nick Evan
0
111
Member Avatar for jowereya

[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

Member Avatar for Nick Evan
0
276
Member Avatar for bhuvanwip

[QUOTE=chandra.rajat;529432]what is coclass?[/QUOTE] [URL="http://msdn2.microsoft.com/en-us/library/aa366751(VS.85).aspx"]link[/URL] Niek

Member Avatar for Nick Evan
0
62
Member Avatar for kux

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

Member Avatar for WaltP
0
157
Member Avatar for AbdullahKhatri

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

Member Avatar for Nick Evan
0
69
Member Avatar for JJ___

1. C&C Yuri's Revenge 2. Quake I 3. Unreal Tournament 4. GTA I 5. Mario III Aaahh.. those were the days...

Member Avatar for maravich12
0
993
Member Avatar for Arctic

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 …

Member Avatar for vijayan121
0
160
Member Avatar for Kupitzc

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

Member Avatar for Nick Evan
0
110
Member Avatar for mark192

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.

Member Avatar for WaltP
0
299
Member Avatar for atish00

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

Member Avatar for Ancient Dragon
0
465
Member Avatar for shadowfire36

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

Member Avatar for John A
0
133
Member Avatar for gcardonav

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

Member Avatar for gcardonav
0
128
Member Avatar for atish00

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 ?

Member Avatar for Ancient Dragon
0
564
Member Avatar for atish00
Member Avatar for atish00
0
184
Member Avatar for jov0708

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

Member Avatar for jov0708
0
510
Member Avatar for Majestics

Also: it's window[B]s[/B].h not window.h. A minor typo can cause a major headache.

Member Avatar for Nick Evan
0
123

The End.