A small program that runs with an error? Rookie advice

Updated on technology 2024-03-15
14 answers
  1. Anonymous users2024-02-06

    public static int m2(int f, int k) {

    This method needs a return value, you define an int type, it needs an int return value, the method itself just prints f, nothing can be returned, you can change the return value type to void, you can also add return null to the method;

    Corrected **.

    public class ruby {

    public static void main(string args) {

    m2(100, 200);

    public static int m2(int f, int k) {

    return null;

    Or maybe so.

    public class ruby {

    public static void main(string args) {

    m2(100, 200);

    public static void m2(int f, int k) {

  2. Anonymous users2024-02-05

    public static int m2(int f, int k)

    Since this function does not return a value, it is modified to the following form:

    public static void m2(int f, int k)

  3. Anonymous users2024-02-04

    This should be when you type, overflowing the int boundary, just pay attention, enter 8888 these numbers in the range of variables and the like, it's no problem.

  4. Anonymous users2024-02-03

    What's wrong, you don't need to type letters, you should be right, you can enter numbers.

  5. Anonymous users2024-02-02

    No problem. The defined n is not used and a warning will appear.

  6. Anonymous users2024-02-01

    The penultimate line should be changed to: string strphonename, both of these errors may be caused by the incorrect passing of this parameter, you can correct it first, and then try to recompile it again!

  7. Anonymous users2024-01-31

    Let me translate it for you'strphonename'Unclear definition, in this case one is that you don't define one is that you misspelled, here you are typosing, you define m strphonename above. So you just change the wrong line to m strphonename.

  8. Anonymous users2024-01-30

    I didn't see a mistake.

    Are you sure it's an error and not a warning?

    The last printf is changed to %d output, take a look.

    Don't know what your device is when you debug?

    If you convert the double type to the int type, you will lose data.

    Can you post the wrong **?

  9. Anonymous users2024-01-29

    You put all the definitions of variables outside the if statement, not in the process statement.

  10. Anonymous users2024-01-28

    You confuse variables with judgments, put the definition of variables outside, don't write variables in the decision, it's easy to make mistakes, and the downstairs is the correct solution.

  11. Anonymous users2024-01-27

    How is that possible? It's weird that it works.

    If there is printf and scanf, you must write the header file include function implementation after the function call, and it must be declared before the call.

    swap() is also indispensable when defined.

    int *p1,*p2;Writing it on the outside indicates that a global variable is defined, so that the two pointer variables can be used throughout the program and are not limited to a single function.

  12. Anonymous users2024-01-26

    What do you want to ask? Is it a bug or an algorithm?

  13. Anonymous users2024-01-25

    :2:20: error: :no such file or directory

    5:19: error: :no such file or directory

    It clearly means that I can't find the document, and it has nothing to do with anything. Why does GCC show such a big list, doesn't it just remind you what the problem is? The latter errors are caused by these two lines.

    Under linux, you can see if there is this file under usr include (deb system can use apt-file find include command to check which package provides the required file), non-linux system is not too clear, you can also press linux to try.

    Teaching everyday tools like Linux Unix as an advanced subject is very problematic in China!

  14. Anonymous users2024-01-24

    It looks like there is an error in the server itself, return 500 error codes, first use the browser to access the test, if there is no error, you can try to use ** to simulate the browser, plus the header.

Related questions
18 answers2024-03-15

There are several ways to create a store mini program, which you can choose according to your actual situation: >>>More

9 answers2024-03-15

Because the system's junk files, temporary files, and too many caches lead to slow response to the boot desktop, especially the network connection, first use the optimization software to clean up the system garbage and then restart it to see, or this shows the possibility of a virus, it is recommended to have a full antivirus, and set the IP address of the local connection to a fixed IP address that you know how to set up, so that it will speed up after booting, so as not to automatically generate the IP address will support the speed, because the automatically generated one needs to be addressed for a long time and then assigned to your IP address, Wasted time and network stability!

7 answers2024-03-15

1. Look at whether the company has an official **, if an Internet company does not even have **, then it is conceivable that the possibility of a leather bag company will be greater. >>>More

4 answers2024-03-15

At present, there are many Mini Program development companies, and how to choose a good and powerful Mini Program development company can be considered from the following aspects: >>>More

5 answers2024-03-15

The ** provided is mainly based on the following two errors: >>>More