ok so if we have a char *hello - ands the string is "hello"
and i do
char *ptr ;
ptr = hello;
then ptr will be pointing at 'h', correct?
Now i have just done an assignmnet in this and completed it using the following terms
if i wanted to move the pointer to the next chatachter i would just do ptr++. If i wanted to use the value of...
$user->Phonenumbers[]->phonenumber = '123 123';
$user->Phonenumbers[]->phonenumber = '456 123';
$user->Phonenumbers[]->phonenumber = '123 777';
I've never seen this kind of syntax
EDIT
This seems more probably a feature,do you guys know how can I implement a feature like this?
...
I'm tempted to define my Python classes like this:
class MyClass(object):
"""my docstring"""
msg = None
a_variable = None
some_dict = {}
def __init__(self, msg):
self.msg = msg
Is declaring the object variables (msg, a_variable, etc) at the top, like Java good or bad or indifferent? I know it's unnecessar...
Many programming languages allow trailing commas in their grammar following the last item in a list. Supposedly this was done to simplify automatic code generation, which is understandable.
As an example, the following is a perfectly legal array initialization in Java (JLS 10.6 Array Initializers):
int[] a = { 1, 2, 3, };
I'm curious...
New to PHP. Can someone please explain this syntax.
$var1->$var2 //note the second $
Thanks
...
I am trying to create a search page, this allows the admin to search through the entries in the database by certain criteria, such as province (like state but diff country)
Here is the code I have so far. The problem is that I am not getting any errors. But I am also not getting any results. The page just posts back and returns to the b...
I tried to do this:
INSERT INTO test123 VALUES(Some text, 'More Text (and in braces.)');
but it doesn't work. The braces in the string
'More Text (and in braces.)'
cause the syntax error. How can I make it work - I need mysql to accept the braces.
...
After reading a description about swapping pointer addresses on Stackoverflow, I have a question about C++ syntax for references.
If you have a function with the following signature:
void swap(int*& a, int*& b)
What is the meaning of int*& ? Is that the address of a pointer to an integer? And furthermore being that it is a pointer re...
$test= <<<EOF
....
EOF;
Never see it before,what's it used for?
...
What is the usage of global:: keyword in C#? When must we use this keyword?
...
Which of these is better to use in regard to performance? ...in regard to readability / understandability? ...in regard to accepted standards?
SELECT *
FROM Wherever
WHERE Greeting IN ('hello', 'hi', 'hey')
OR
SELECT *
FROM Wherever
WHERE Greeting = 'hello'
OR Greeting = 'hi'
OR Greeting = 'hey'
The first seems more intuitiv...
Is it possible, while using glob syntax for an .hgignore file, to recursively ignore certain files and folders, except one?
Assuming that you have:
a/
a/b
a/c
a/d
Something like:
syntax globe:
a
^a/b
This should ideally ignore c and d and keep b.
I know this has been discussed in other SO questions, but it seems they're all using...
I was reading the Guestbook example for Happstack and noticed the >> symbol which I didn't see before in the textbooks I studied to learn Haskell (for instance see line 23). What is it?
Example
I could not find it in Google because it ignores the >> totally (Bing does not but comes up with tons of non-related results).
Thanks!
...
I am currently doing this, to do different things based on an object's type:
actions = {
SomeClass: lambda: obj.name
AnotherClass: lambda: self.normalize(obj.identifier)
...[5 more of these]...
}
for a in actions.keys():
if isinstance(obj, a):
return actions[a]()
Is it possible ...
Okay, so I have this CSV file of products and all the products have an ID number. I am going to import this CSV into an existing (empty) database table where the columns in the database are named the exact same name as the first-row columns in the CSV file.
There is one extra column in the DB called URI. I need to build this during (o...
After namespace, class, struct, enum, for, foreach, while, switch, do, using, unchecked and at the beginning of methods, shouldn't Visual Studio automatically include curly brackets? How to activate this feature?
...
I'm trying to use appcfg.py to upload to localhost/Google App Engine. I've basically been following these instructions word for word, but now I'm having trouble.
Here is the command I'm trying:
appcfg.py upload_data --app-id=appname --config_file="path\to\ItemLoader.py" --filename="path\to\data.csv" --kind=Item --url=http://localhost:8...
Hi there,
I'm having hard time understanding, why the compiler requires using break statement. It's not possible to miss it since the fall through is now allowed. I see the reason for the break in C or C++, but is it needed here.
Why it's not a built-in behavior to break after a case is over ? Isn't it just a syntax with no semantic?
...
Possible Duplicate:
Whats your preferred pointer declaration style, and why?
I know that technically all three ways below are valid, but is there any logical reason to do it one way or the other? I mean, lots of things in c++ are "technically valid" but that doesn't make them any less foolish.
int* someFunction(int* input)
{...
I find the documents frustrating. What are the basic lines I need to add to my config file to get it working?
...