为什么我的输出文件与输入文件不同?

时间:2019-04-24 03:30:42

标签: c++

我正在从文本文件读取并写入文本文件,但是输出文件与输入文件不匹配。

原始的TINN1文件由Fortran程序编写为文本文件。使用Fortan / C ++混合编程,我能够在Fortran中初始化数组并将其传递给C ++以编写输出文件,该输出文件是输入文件的镜像。但是,用C ++进行读写是一项挑战。我能够使用通过Google找到的其他示例来生成代码。

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>

<script type="text/javascript">

function validateForm() {
      var uname = document.getElementById("uname").value;
      if (uname == ""){
          bootstrap_alert.warning = function(message) {
            $('#alert_placeholder').html('<div class="alert alert-danger alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button><span>'+message+'</span></div>')
        }

$('#clickme').on('click', function() {
            bootstrap_alert.warning('Please enter your name');
});
          return false;
      }
  }
</script>
</head>
<body>
Name: <input type: "text" name="uname" id="uname" />
<input type = "button" id = "clickme" value="Submit"/>
<div id = "alert_placeholder"></div>

</body>
</html>

1 个答案:

答案 0 :(得分:5)

此:

in >> ik , ta1[k] , tv1[k];

应为:

in >> ik >> ta1[k] >> tv1[k];
相关问题