Questions tagged [definition]

A generic tag for topics providing definitions.

A generic tag for topics providing definitions.

1574 questions
-1
votes
2 answers

Segmentation fault in C++ in printing linked list elements

please help. I am getting segmentation fault when i try to print elements in this linked list. i first declare a class and the function to insert and display the elements of the list are its functions. code: #include using namespace…
-1
votes
1 answer

Where can I find function definition of overloaded operators of string class of c++?

Is there any way to find already overloaded operators' functions of string class of C++ by exploring C++ libraries on my PC? I use dev C++ to code.
Ali Azlan
  • 77
  • 1
  • 9
-1
votes
3 answers

What is the difference between (self) and (self,) in python method?

Let's see a code sentence def consturct_modules(self,):. I have a simple question about why this method defines (self) as (self,). It seems to me that (self) is proper form. What is the difference?
ih s
  • 71
  • 7
-1
votes
1 answer

Indentation problems 3.7

Here is the code def has_stop(dna,frame) : stop_codon_found=False stop_codons =['tga','tag','taa'] for i in range(frame,len(dna),3) : codon =dna[i:i+3].lower() if codon in stop_codons: stop_codon_found=True …
opt135
  • 141
  • 1
  • 8
-1
votes
1 answer

How to merge two hands of cards together in Haskell?

I'm still very new to Haskell, and I'm curious as to how I would merge two Hand's together, so that, the first hand is placed on top of the second hand. I want it to be an infix operator, namely (<+). Here's some code to assist you. I keep getting…
Alex
  • 394
  • 1
  • 4
  • 15
-1
votes
1 answer

Function prototype, without definition

I'am developing a library, that can't use Classes. I have a function I call when a get a KeyDown event and i want to call a function that i set the prototype for before in the library. The thing is, I don't want to be mandatory for the user to…
-1
votes
2 answers

The scalar type additionnal in C++

In C the scalar type are: floating_point (double float, ...) integral (int, char, long, ...) pointer enum In C++ the scalar type added are just : integral (bool) nullprt_t member pointer (member object pointer and member function…
Ben
  • 131
  • 1
  • 1
  • 7
-1
votes
1 answer

The output screen goes blank

I wrote this code while studying linked lists on leetcode. In this problem, at the end, where deleteAtIndex function is called with index 6, the screen goes blank. It is working for all other values where the index is valid. But for invalid values…
-1
votes
2 answers

Lack of consistency in python, completely contradictory behaviour of defined variables before function

I'm losing my mind because my code is doing completely contradictory action. I'm defining packet_counts as Counter() before defining function custom_action and there is no problem. When I try to define test1 as int exactly the same way as…
Yenjay
  • 55
  • 8
-1
votes
1 answer

How to create a function that alloccate 10 bytes to a pointer, then check whether pointer has been allocated yet, return boolean?

sorry for my bad English. I'm learning C programming from the root at the moment, and I have a homework. The problem says: Create a function that allocate 10 bytes dynamically to a pointer, then check whether pointer has been allocated? The function…
phongisntreal
  • 65
  • 1
  • 12
-1
votes
1 answer

Haskell gets confused with horizontal lines

I tried to practice haskell a bit but I didn't get the following code to work: rems :: Int -> [Int] -> [Int] rems _ [] = [] rems k (x:xs) | k == x = rems k xs | otherwise [x] ++ rems k xs main = print $ rems 3 [5, 3, 2] This function…
-1
votes
3 answers

While loop iterating on too many elements in C++

When I run the code I get all those numbers as outputs which means that my while loop seems to be going over elements that it should not got over. Why is this happening ? For context I am currently learning C++ with a tour of C++ and I am very…
-1
votes
1 answer

Why is a separate variable declared in a Go type switch?

I am having trouble understanding why type switches are written with an additional variable defined in the switch statement. The below code seems to be the sanctioned way of doing things: func test_func(i interface{}) { switch v := i.(type) { …
-1
votes
3 answers

Passing a Struct definition in C#

I have an issue with passing a struct definition to a function. Not an instance of a struct, but the definition. We are open to alternative methods of doing what we want, but for right now, this is what we're trying to do - We are writing a user…
E Devitt
  • 67
  • 9
-1
votes
1 answer

define variable with braces?

The book defines javascript variable with braces '{' which returns error "SyntaxError: Unexpected token { " on my compiler (npm 5.6.0) I found the similar problem here (SyntaxError: Unexpected token { in javascript) which used function inside the…
choChoi
  • 1
  • 1