User Profile
Collapse
-
Rizladonovich replied to Is ((char **) &var_name); a cast to char array giving existing pointer to var_name?in CThank you :) -
I do not understand how you expect both
"In the parent: child PID is $pid\n";
AND
"In the child\n";
to be printed in same execution. :?
It has nothing to do with the browser.
Did you read on the links i added?
I.e. control-structures else
Code:/* 1. assign PID of the child process to variable $pid */ $pid = pcntl_fork();
Leave a comment:
-
Your code set value to i from input (cin).
If you enter 65, and then set c = i, c holds 65 witch interprets as 'A' as character. "cout'ed" this gives "A" (as long as your PC does not have a very very strange coding table).
Execution would be:
Code:write a while number 88<enter> X or write a while number 65<enter> A
Leave a comment:
-
Rizladonovich replied to Is ((char **) &var_name); a cast to char array giving existing pointer to var_name?in CThank you for reply.
Then unchangeable pointer is out of the way :)
In other words a const character pointer are defined, and as soon as it is initialized by exec_name = strrchr (argv[0], PATH_SEPARATOR) ; the result is a constant character array (null terminated string)
So the "((char **) &exec_name); " is a cast then?
My test:
Code:#include <stdio.h> #include
Leave a comment:
-
Could be anything. Depend on the context. Vaguely one could say it is a defined unit separating data without (necessarily) being part of the data itself.
I.e. in the string "what is", the quotes delimit the string, but are not a part of it. A data stream can have a defined byte-sequence/flag/etc delimiting records; i.e a comma delimited list:
record1,record2 ,record3
And so on...
...Leave a comment:
-
Rizladonovich replied to preg_match may not fail on 4 and 5 octet sequences, even though they are not supportein PHPSounds like it does not always fail on sequences that is not part of the UTF-8 specification.
Ref table 5-1 under pt 5.9.4 here Character Encoding
(note to self: test this soon)Leave a comment:
-
Well, your control-flow does not allow more than one statement to be printed, as is correct.
Control Structures
boolean casting
And as the documentation says regarding pcntl_fork: "On success, the PID of the child process is returned in the parent's thread of execution, and a 0 is returned in the child's thread of execution. On failure, a -1 will be returned in the parent's context,...Last edited by Rizladonovich; Sep 19 '10, 06:36 AM. Reason: specified last citation to be about pcntlLeave a comment:
-
Rizladonovich replied to auto-papolate values in corresponding textboxs retriving values from my database(MySqin PHPYou want auto-update form while typing?
If so you have to check out XMLHttpRequest aka AJAX - in other words php + javascript.
Google ajax, json, jquery and so on. It is not to hard to write from scratch, but there are also loads of libraries out there. Important to think security.
As of PHP 5.2.0, the JSON extension is bundled and compiled into PHP by default.
https://developer.mozil la...Leave a comment:
-
> ...
> The construct function actually has two underscore
> function __construct()
> and removing an underscore solves the problem.
> This is true.But the problem remains that I can no longer view the page I designed
> ...
That sounds very strange.
Construct should have two underscores if it is supposed to be a class construct.
ref: http://www.php....Leave a comment:
-
date_default_ti mezone_set returns a boolean value (check man page). In other words; your statement set $this->date to TRUE if success or FALSE if failure.
The "best way" (could of course depend on special cases in code) is to set it in php.ini.
If not set it "early" in the code, so that you are sure it is set before any time function are used.
So: do _not_ change line 5, but add...Leave a comment:
-
Rizladonovich replied to Warning: Cannot modify header information - headers already sent by (output started ain PHPsomewhere the script start to send data to user, before you get to redirect.
You could:
Do a flush + exit/die before the redirect(s), and look at source code of result page and see if there are anything before the error message. (not necessarily necessary with the flushing')
It can also be useful to use wget with save header option: wget --save-headers some_address
Also, take a look into buffering...Leave a comment:
-
Rizladonovich started a topic Is ((char **) &var_name); a cast to char array giving existing pointer to var_name?in CIs ((char **) &var_name); a cast to char array giving existing pointer to var_name?
I am currently reading/learning c. I often like to look at code while I read, - to see more practical use then often are feasible in educational books.
I am looking at some code from wget.
Code extracted from wget.
Code:/* file: mswindows.c */ void windows_main (char **exec_name) { char *p; /* Remove .EXE from filename if it has one. */ *exec_name = xstrdup
No activity results to display
Show More
Leave a comment: