小编sep*_*p2k的帖子

在APL中打印前n个奇数

我刚开始探索APL.虽然熟悉C++和python,但我执行了一个简单的程序'打印前n个奇数',其中n是APL中的输入.请帮助APL程序员.

apl

-2
推荐指数
1
解决办法
419
查看次数

编译简单的应用程序给出错

我正在尝试complile这个简单的应用程序:

#include <winsock2.h>
#include <iostream.h>
#include <string.h>

using namespace std;
unsigned long WinsockStart()

{

WSADATA wsa;
unsigned long ULONG;
struct hostent *target;

if(WSAStartup(MAKEWORD(2,2), &wsa) < 0)
{
cout << "Exploit failed!" << endl;

WSACleanup();
return 1;
}

if((target=gethostbyname("www.website.com/script.php"))<0)
{
cout << "That is not a valid host bro!" << endl;

WSACleanup();
return 2;
}

ULONG = *(unsigned long*) target->h_addr;
return ULONG;
}

void error_exit(string text)
{
cout << text;
WSACleanup();
exit(EXIT_FAILURE);
}

int main()
{
SOCKET sock;
struct sockaddr_in addr; …
Run Code Online (Sandbox Code Playgroud)

c++

-3
推荐指数
1
解决办法
618
查看次数

我找到了一个用C编写的base64解码器。当我用GCC编译它时它工作正常。但是cl.exe出错了。为什么?

/**
 * Copyright (c) 2006-2018 Apple Inc. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, …
Run Code Online (Sandbox Code Playgroud)

c gcc cl

-3
推荐指数
1
解决办法
112
查看次数

编译时出错

#include<stdio.h>

int main()

{

  int c, nl;

  nl = 0;

  while ((c = getchar()) ! = EOF){
    if (c =='\n'){
      nl++;
    }
    printf("%d\n", nl);
  }

}
Run Code Online (Sandbox Code Playgroud)

当我尝试编译时,gcc -o fun2 countline.c 我得到了这个错误

countline.c: In function 'main':
countline.c:12:26: error: expected ')' before '!' token
Run Code Online (Sandbox Code Playgroud)

导致此错误的原因是什么?我错过了什么?我无法弄清楚.

c

-4
推荐指数
1
解决办法
102
查看次数

为什么Java编译器需要返回值?

public MyObject method1() {
  boolean someBoolean = true;
  MyObject obj = ...;

  if(!someBoolean) method1();
  else return obj;
  // flow should never come to this statement, but compiler requires this return. why?
  return null;
}
Run Code Online (Sandbox Code Playgroud)

为什么java编译器需要最终的return语句?

-Prasanna

java

-4
推荐指数
1
解决办法
104
查看次数

从cmd运行.class java文件.问题

cmd中的类文件,使用以下命令,我得到输出:

在此输入图像描述

错误是:"错误:无法找到或加载主类CustomerManager.class"

知道如何解决这个问题吗?

java

-5
推荐指数
1
解决办法
423
查看次数

标签 统计

c ×2

java ×2

apl ×1

c++ ×1

cl ×1

gcc ×1