小编int*_*jay的帖子

错误LNK2019和致命错误LNK1120我在c ++中收到这些错误

我不知道如何解决这些错误.我写了整个代码,并试图看看它是否是括号的问题,但也没有帮助.我不知道它是什么线但我相信它是在这个功能.

错误LNK2019:未解析的外部符号"int __cdecl read_file_in_array(int(*const)[3])"(?read_file_in_array @@ YAHQAY02H @ Z)在函数_main致命错误中引用LNK1120:1未解析的外部

我相信这个与括号有关

    #include <iostream>
    #include <fstream>
    using namespace std;
    int read_file_in_array(int exam[100][3]);
    double calculate_total(int exam1[], int exam2[], int exam3[]); // function that calcualates grades to see how many 90,80,70,60
    //void display_totals();
    double exam[100][3];

int read_file_in_array(double exam[100][3])
    {
        ifstream infile;  
        int exam1[100];
        int exam2[100];
        int exam3[100];
      infile.open("grades.txt");// file containing numbers in 3 columns
        if(infile.fail()) // checks to see if file opended
            {
            cout << "error" << endl;
            }
        int num, i=0,j=0;
        while(!infile.eof()) // reads …
Run Code Online (Sandbox Code Playgroud)

c++ arrays linker-errors

0
推荐指数
1
解决办法
394
查看次数

你如何检查c ++中的行尾?

我必须从用户接受空格分隔的整数,但在遇到新行时停止.例如:

3 5 7 9
23 47
6
Run Code Online (Sandbox Code Playgroud)

在这个例子中,我必须存储3, 5, 7, 9在数组1中,23, 47数组2中,存储6在数组3中.不幸的是,我不知道如何在C++中检查行尾.请帮帮我.

c++

0
推荐指数
1
解决办法
745
查看次数

在for循环中使用字符串连接时的异常行为

因此,下面的代码正确地从字符串中删除所有元音.

def disemvowel(string):
    # Letters to remove & the new, vowerl free string
    vowels_L = list('aeiouAEIOU')
    new_string = ""

    # Go through each word in the string
    for word in string:

        # Go through each character in the word
        for character in word:

            # Skip over vowels, include everything elses
            if character in vowels_L:
                pass
            else:
                new_string += character

    # Put a space after every word
    new_string += ' '

    # Exclude space place at end of string
    return new_string[:-1] …
Run Code Online (Sandbox Code Playgroud)

python

0
推荐指数
1
解决办法
271
查看次数

python目标字符串键计数无效语法

当我在代码下面运行时,为什么会出现"无效语法".Python 2.7

from string import *

def countSubStringMatch(target,key):
    counter=0
    fsi=0 #fsi=find string index
    while fsi<len(target):
        fsi=dna.find(key,fsi)      
        if fsi!=-1:
           counter+=1
        else:
            counter=0
            fsi=fsi+1
        fsi=fsi+1
    #print '%s is %d times in the target string' %(key,counter)

def countSubStringMatch("atgacatgcacaagtatgcat","atgc")
Run Code Online (Sandbox Code Playgroud)

python string syntax

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

删除2D数组C++

这两种释放2D阵列的方法是否相似?

int** M = new int*[5];

for (int i = 0; i < 5; ++i)
    M[i] = new int[3];

for (int i = 0; i < 5; ++i) {
    for (int j = 0; j < 3; ++j) {
        M[i][j] = i + j;
    }
}
Run Code Online (Sandbox Code Playgroud)

删除我:

for (int i = 0; i < 5; ++i)
    delete [] M[i];
delete [] M;
Run Code Online (Sandbox Code Playgroud)

并删除II:

delete [] *M;
delete [] M;
Run Code Online (Sandbox Code Playgroud)

这两个代码是等价的吗?

c++ arrays pointers

-3
推荐指数
2
解决办法
2976
查看次数

标签 统计

c++ ×3

arrays ×2

python ×2

linker-errors ×1

pointers ×1

string ×1

syntax ×1