c tag

1304 questions


1 answers
141 views
0
Initialize static const string in class

Isn't it okay to initialize the static const member variable within the class?The error message says to initialize out of line.I don't want to use #define but what should I do Static data member of ty...

2 years ago

1 answers
27 views
0
cException when entering a string in language integer input scanf

#include <stdio.h>#include <stdlib.h>int main(){ int num = 0; while(1) { printf(number : ); scanf(%d, &num); printf(%d\n, num); num = 0; }}If you enter a non-integer string here, is th...

c
2 years ago

1 answers
45 views
0
What is the difference between #include and #include "filename"?

The method of including C/C++ is to use <> and There are two. What's the difference between the two?

2 years ago

1 answers
135 views
0
To compare multiple variables to a single value

I'm now creating a function that returns a string of three words by comparing several variables with one integer value. I wonder how to write this in Python. For example, x = 0y = 1z = 3Mylist = []if ...


1 answers
68 views
0
Is there a way to execute the Python code stored in the form of a string?

Is there a way to execute the Python code stored in the form of a string?I thought my friend told me I could do it, but I didn't listen because I thought I didn't need it ㅜ

2 years ago

1 answers
118 views
0
Static initialization block

Until now, I understood that static initialization block is used when it is impossible to set the value of the static field with one line.But I don't know why I need a special block for that work. For...


1 answers
164 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
27 views
0
Password validator code, but segmentation error occurs.

Use_Programming Language: cCode: #define _CRT_SECURE_NO_WARNINGS#include <stdio.h>#include <stdlib.h>#include <string.h>int valid_char(char* a, int b);int valid_num(char* a, int b);i...

c
2 years ago

1 answers
134 views
0
What is the role of the keyword static in the class?

package hello;public class Hello { Clock clock = new Clock(); public static void main(String args[]) { clock.sayTime(); }}When there was a code like this Cannot access non-static field in static meth...


1 answers
50 views
0
c After initializing the language string, tap for input/output of the rest of the file

After initializing the string to '\0', I took the string and compared it, and I saw '\0' at the end of the string I received, and there are meaningless characters behind it. Is this meaningful? This t...

2 years ago
« - 83 - »

© 2024 OneMinuteCode. All rights reserved.