1,668 questions
Score of 4
3 answers
480 views
Why function must be defined with static when compiling
I wanted to see what happens if I include the source file instead of the header file.
main.c
#include <stdio.h>
#include "func.c"
int main(void)
{
printf("%d\n", call());...
Score of 4
2 answers
172 views
If a declaration with an initializer is always a definition, why isn't the declaration of a static const member variable a definition?
In The C++ Programming Language 4th edition, in §6.3, page 153, I read
Any declaration that specifies a value is a definition
Again, in §15.2, page 421,
a declaration with an initializer is always ...
Score of 0
2 answers
123 views
Automatic initalization of local variables
According to the C standard, the local variables declared in the local scope would carry garbage value until they are explicitly initialized. In contrast to that, if the variable is declared in the ...
Score of 2
2 answers
244 views
Is `int x;` really just a declaration or an implicit definition too?
In C, suppose an object is declared, for instance int x; as an automatic variable. Without initializing it with any value, is it still considered just a declaration and not definition?
Cause ChatGPT ...
Score of -3
1 answer
149 views
C++: What does the (-1) mean at the end of the parameter list in this function?
I don't understand the definition of a function below: What does the (-1) mean at the end of the parameter list?
template<typename RatioT = std::milli>
bool rclcpp::client::...
Score of 0
1 answer
64 views
How does Python create values for variables without assignment?
I am reading Engineering a Compiler (Cooper, Torczon) 3rd Edition, Chapter 5 Syntax-Driven Translation. It contains the paragraph:
PYTHON does not provide type declarations. The first use of a name x ...
Score of 0
1 answer
179 views
Powershell Core Get-Member
Humbling seeking help. Beginner Powershell Core 7.4.2 scriptwriter. In reference to Get-Member results. My background is that I really prefer using Powershell Core's built in documentation rather than ...
Score of 0
1 answer
96 views
Defining function in Python whose one argument is list
There is a part of mathematics called the theory of multiple zeta values (MZVs) introduced around 1992. In this theory, we study the properties of parametric nested infinite series (see, e.g., here ...
Score of 1
1 answer
141 views
Set range to read values from one worksheet and write to another
The script is intended to:
Read values from column LADUNGSNUMMER in the worksheet NVL cell by cell.
Find each value in column Transport of the worksheet DATA.
Read the corresponding values from ...
Score of 0
1 answer
198 views
Forward declaration struct member access
I have a forward declaration of a struct in .h file and full declaration of the same struct in .c file. I want to access it's members, but I get
member access into incomplete type struct channel
Here ...
Score of 0
1 answer
1990 views
Authentication method detail - Password in the cloud
"Password in the Cloud" - is this definition meant to be a catch-all term for any saved/stored credential (via Chrome, Bitwarden, or any other password manager). Or does it have a more ...
Score of 0
1 answer
87 views
How to correctly declare function with templated class as return type in header? [duplicate]
I have a template class declared in a header file.
// Matrix.h
template <class X> class Matrix {};
In another header file I have a function declaration which has an instantiation of that ...
Score of 0
1 answer
180 views
How to define a seperate implementation of a template class constructor [duplicate]
I am working with an old code in C++ that uses a custom implementation of a matrix class.
The matrix is class is implemented as a template class. The declaration looks like this
/**********************...
Score of 0
2 answers
393 views
How to check strength password with function and loop while checking off 3 criteria boxes in Python?
I have an assignment to create a password check that says if the password is strong (3 criteria checked off) moderate (2 criteria checked off) or weak (1 or less). The criteria are: 1: containing 2 of ...
Score of 1
4 answers
151 views
How can i solve a problem by using the outcome of a function as a variable in the following?
I have come up with this code:
lista= [5,3.2, 'Error', 44, 'Error', 35]
listb= [70, 70, 20, 410,'Error', 4.9]
for i in range(6):
a= lista[i]
b= listb[i]
if a == 'Error' or b == 'Error':
...