struct tag

27 questions


2 answers
145 views
0
About structure pointers

struct Person { char name[20]; int age; char address[100] };int main{ { struct Person p1;struct Person *ptr;ptr = &p1; } } Even if there is no third line in int main, the variable ptr in the secon...

2 years ago

1 answers
140 views
0
I have a question about initializing the pointer variable of the C language structure.

Hello.There are source codes from 1 to 3 as shown below.Which is the better way to initialize, number 1 or number 2?And if you initialize it as duplicate(?) like number 3, there is no error in the bui...

2 years ago

1 answers
134 views
0
Is this the only way to use structure for C in Python?

Is this the only way to use structure for C in Python?class MyStruct(): def __init__(self, field1, field2, field3): self.field1 = field1 self.field2 = field2 self.field3 = field3I used to use C (I ...

2 years ago

1 answers
82 views
0
To create a constructor for a C++ structure?

How do I create a construct in C++ structure?I want to define the constructor, but I don't know the grammar

2 years ago

1 answers
173 views
0
Where is the function/operator where C finds out that two objects are the same?

Where is the C standard function that determines whether two instances are the same or not?I used == or is in Python, but I can't find it in C

2 years ago

1 answers
96 views
0
It says it's a violation of access, but I don't know if you declared it or if it's out of memory...I don't know the cause.

It says Access violation but I don't know the cause.What I want is a program that takes the class, name, and department and makes it look prettyWe tried to float in two ways: return the structure and ...

2 years ago

1 answers
73 views
0
[C] When creating code by separating it into a header file, where should the user declaration structure be entered?

While writing the header file and writing the code, I have a question, so I'm asking you.-- myheader.h#pragma oncetypedef struct node { int data; struct node *next;}NODE;typedef struct { int count; NO...

2 years ago

1 answers
70 views
0
c Language file input/output question. It's a function to find the width of the circumference by printing coordinates, but the width of the circumference doesn't come out

//You receive a bundle of two coordinate values from a file to construct a rectangle//Create a program that calculates the width and circumference of each and outputs it to the screen //1. Receive the...

2 years ago

1 answers
116 views
0
Data search question in C language binary search.

#include<stdio.h>#include<stdlib.h>int idxsearch(int ar[], int first, int last, int target) { int mid = (first + last) / 2; if (first > last) return -1; else { if (ar[mid] == target) ...


1 answers
97 views
0
How do I initialize all C++ structure member variables to zero?

Is there an easier way to initialize all object member variables to zero?Now struct Snapshot{ double x; int y ;};int main(){ struct Snapshot mystruct; mystruct.x = 0; mystruct.y = 0;}They're resettin...

« - 2 - »

© 2024 OneMinuteCode. All rights reserved.