python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
is it safe to use the same variable name repeatedly in a series of functions?
Is it safe to re-use the same variable name repeatedly in a series of functions? My code is:
with open(thisdoc_dir + '/' + 'metadata.txt', 'w') as m:
m.write(str(metadatas[1]) + '\n')
m.close(...
Fred Zimmerman
Votes: 0
Answers: 1
Initialize member string with class object name in C++?
Is there a way to instantiate an object and have a string member take the object's name? I would also not mind for a gcc builtin.
Here's an example:
#include <string>
class A
{
std::str...
glades
Votes: 0
Answers: 0
Variable with same name with a struct type compiling only if it's not a template
Why is it allowed to have a variable with same name with a struct type only if it's not a template?
Why is this considered okay:
struct Foo {
int func(int) const;
};
struct Foo Foo;
but not this...
ofo
Votes: 0
Answers: 1
How do I change the value of one variable based on the value of another variable?
I have two variables. One categorical one with labels that take values 1-7. The value 7 indicates "other"
The other variable is the text that represents that "other".
col1 col2
1 ...
Victor Nielsen
Votes: 0
Answers: 1