Try here:-
http://www.icce.rug.nl/documents/cplusplus/
or Bruce Eckel's excellent free online Thinking in C++ books.
http://maththinking.com/boat/languageBooksIndex.html
These should offer you some insight into the differences and similarities between C and C++.
paulf
Thinking about it, don't read the file backwards a byte at a time, that would be too painful. If you don't know the length of a record, have a guess at the approximate size of 100 lines and seek back to there. Read the end of the file into a string and count the linebreaks. If there's less than...
I don't think there are any built in mechanisms to do this but I'm sure its possible using some combination of the following:-
open the file
seek the end
use tell to get the current file position
If your records are fixed length deduct length x 100 in bytes from tell and then seek there and...
It is not possible to cast string to a double value in the way you suggest. However, you can convert it with the following function from <stdlib.h>
double atof(const char *s) //ascii to float
paulf
One thing I noticed is that this line:-
$code =~ s/[category]/category/g;
is probably meant to replace [category] with category but the [] symbols are used in regexs to group chars so try escaping them like so:-
$code =~ s/\[category\]/category/g;
paulf
Yes, you do need to worry.
If you're using a unix type system you should lock the file with flock(<FILE_HANDLE>, 2), where 2 is exclusive lock. flock is only voluntary, and will only preserve the file form other scripts using flock as well. Un(f)lock with flock(<FILE_HANDLE>, 8) when you're...
Well, I guess the permission thing is because the script that creates the directory is not leaving it in a state where it can be deleted by another script. In your file creation script after the point where it creates the directory try adding the line, (and create a log file while you're at...
Sorry if I confused you with the logfile thing, it's really very simple. It just means open file where you can write stuff from your script. Then you can read them with in Notepad or whatever when your script has run to see what happened:-
Add this line to the top of your deleteuser...
Not sure what the problem is but you could try this to find out.
Set up a logfile somewhere and have your script open it for write each time it runs. Modify your rmdir lines to be something like:-
rmdir("$add_ntpath\\accounts\\$delete") or print LOG "rmdir failed because...
Tels
This how we used to call our scripts with SSIs when I used to work for a dotcom. All our servers were Linux but it might be worth a try.
<!--#include virtual="/cgi-bin/script.pl"-->
paulf
Well, first off I don't know a thing about Windows web servers but have you tried any of the following:-
i, Check that any simple SSI will work.
<!--#echo var="SERVER_NAME"--> for example. Maybe your server isn't configured to run SSIs.
ii, Should there be a colon after the command...
Just as an aside. If you want to read a whole file in real quick you should consider undefining the line separator thus.
{ #brackets limit the scope of local
local $/ = undef;
$buffer = <IN>; #the whole will now be read here
}
paulf
Try adding these tags into the header of your htm page containing the chat.
<meta http-equiv="Refresh" content="7">
<meta http-equiv="Pragma" content="no-cache">
content="7" will make the page refresh automatically every 7 secs. In order to...
This is a good tutorial to get you started. It's all in C but you can convert it I guess.
http://www.ecst.csuchico.edu/~beej/guide/net/
Also, try searching for these two docs on http://www.google.com
"An Introductory 4.4BSD
Interprocess Communication Tutorial" and
"An...
One reason could be (from the code you've given us) that when an && statement is evaluated if the first term is false the second term is not evaluated (since there's no point, the statement will still evaluate to false). So your 'loop < size' statement is probably not being called in time to...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.