Questions tagged [definition]

A generic tag for topics providing definitions.

A generic tag for topics providing definitions.

1574 questions
-1
votes
1 answer

C++ extern variable exception (Solved)

extern int eg_i = 0; int main(){ ++eg_i; // 1 return 0; } This code surprisingly throws no compile error. Because if an extern variable is declared with initialization, it is taken as the definition of the variable as well. I didn't know…
GamerCoder
  • 139
  • 6
-1
votes
2 answers

char *test[]. What does it means this structure?

Example: // test.h #define MAX 3 test.cpp static char *movies[MAX] = { "The Departed", "The Crow", "Hot Fuzz"}; // Why not use Vector, or Vector, or an Array, or another data type? What benefits do i have over the other data…
breakou7z
  • 3
  • 3
-1
votes
1 answer

Is there a shortcut to write a function with the same definition but different prototypes?

I have a method of a class which basically looks like this: void MyClass::method() { // Here I'm just doing something with parameters which are class attributes parameter_3 = parameter_1 + parameter_2 } I need another method which would…
Kaiyakha
  • 1,463
  • 1
  • 6
  • 19
-1
votes
2 answers

How to use a function from another .c file?

I'm using RTKLIB (it is not important), and inside a directory there are multiple .c files: rtcm.c rtmc2.c rtcm3.c etc. etc. Inside the same directory, I created a main.c file, where the program is executed. Inside main.c I call different…
-1
votes
2 answers

Argument definitions in printf()

In the following C code: printf( "Coffee!" ); and scanf("%d", &coffee); printf("\nI’m baking %d coffee!", coffee); Are "Coffee!" and coffee considered arguments?
zackBYE344
  • 63
  • 5
-1
votes
3 answers

How to return data from one definition to another one?

I am messing around with python, and am trying to make a simple data cleaning program. I'm trying to pass the title values from the read_excel module, to the output module. But, it keeps saying name title is not defined. Here is my code: import…
zhangruibo101
  • 67
  • 1
  • 10
-1
votes
1 answer

declare variable of a type X in class X when defining my class X

I know that the title is not clear but sorry for my english I did not find how to formulate my question. So I hope below I could explain it further. In fact I was reading a code where the user, when he was defining a class (let's called X), he…
Blood-HaZaRd
  • 2,049
  • 2
  • 20
  • 43
-1
votes
1 answer

What is the definition of source code and code?

What is the exact definition of source code and code? printf("hi\n"); Is this a source code or a code? int main(void) { printf("hi\n"); } This is definitely a source code, right?
doraemon1
  • 113
  • 1
  • 11
-1
votes
3 answers

How do i make copy constructor for 2 pointer variable in c++?

I have two pointer variables as data members. How do I make copies of these two data members? How do I make a deep copy constructor for this? I tried many times, but it's not working. class abc { float *number1; float *number2; public: …
john
  • 79
  • 7
-1
votes
4 answers

How would I do a definition for a name validation

What I want to do: I am trying to make a definition that takes an input (name as string) and checks if the name is in a set list. If it is, the program will continue. If it isn't, it will give the user 2 more chances to enter their name…
Aman H
  • 1
  • 2
-1
votes
1 answer

A conflict exists with definition newBox in namespace internal

function makeABox(e):void { if (e.name == "seri1"){ var newBox:karo1 = new karo1(); }else if(e.name == "seri2"){ var newBox:karo2 = new karo2(); }else{ var newBox:zemin1 = new zemin1(); } ust_bar.addChild(newBox); newBox.x = i*60; newBox.y =…
Dee
  • 1
-1
votes
3 answers

Explication of Scheme code for permutations

Here is a Scheme code to produce the permutations of a list of elements: (define (remove x lst) (cond ((null? lst) '()) ((= x (car lst)) (remove x (cdr lst))) (else (cons (car lst) (remove x (cdr lst)))))) (define (permute lst) …
-1
votes
1 answer

Procedure to display and return something in scheme?

I want my procedure to print something, then return that something. I tried this (define (print x) ((display x) x)) Shouldn't it be as straightforward to say that this procedure displays x at first then returns it as it's expressed at the…
Snusifer
  • 485
  • 3
  • 17
-1
votes
2 answers

How to allow to use not-yet-known-type in its type-definition in c?

I would like to use type, which is yet not know, becuase I am using it in its own definition: typedef struct{ int value; node_t *next; } node_t I do not to create new variable (which I would do, If I use tag of that struct (typedef struct…
milanHrabos
  • 2,010
  • 3
  • 11
  • 45
-1
votes
2 answers

defined code executes before called upon using tkinter button

I am working on a program that lets users store their usernames and passwords, and hashes the plaintext where they are stored (hence the commented out hashing code). However, I am using tkinter for the GUI, and one of my buttons runs a defined…
Tf0R24
  • 65
  • 1
  • 8