我有一个小问题,我希望我的页脚留在屏幕的底部position: absolute.但我margin: auto把它放在屏幕中间不再工作了.
HTML:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='Content-Type' content='Type=text/html; charset=utf-8'>
<link rel="shortcut icon" href="../IMAGES/favicon.ico">
<title>TEST</title>
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="../css/stylesheet.css">
</head>
<body>
<div id="header">
<div id="logo">
<img src="../IMAGES/logo.png" />
</div>
<div id="logotitel">
Den Allerstrafste "Ful-Ambi" Live-Band van groot Antwerpen en omstreken!
</div>
</div>
<div id="nav">
<div id="links">
<a href="index.php"><div class="link">Home</div></a>
<a href="wie.php"><div class="link">Wie is wie</div></a>
<a href="fotos.php"><div class="link">Foto's</div></a>
<a href="repertoire.php"><div class="link">Repertoire</div></a>
<a href="links.php"><div class="link">Links</div></a>
<a href="contact.php"><div class="link">Contact</div></a>
</div>
</div>
<div class="clear"></div>
<div …Run Code Online (Sandbox Code Playgroud) 我在阅读文件时遇到了一个小问题.代码如下.我试过这个http://www.tutorialspoint.com/cprogramming/c_error_handling.htm来检查错误,但没有.该文件位于正确的位置并具有正确的名称.
当我尝试打开它时,它的值为1,结构的所有成员都具有以下值"无法读取内存"
有任何想法吗?
struct node * fileToLinkedList(char * filename) {
FILE * inputFile;
inputFile = fopen(filename, "rb");
if (inputFile =! NULL) {
struct program * programPTR;
struct node * listStart = NULL;
while ((programPTR = getProgramFromFile(inputFile)) != NULL)
addProgramToList(&listStart, programPTR);
fclose(inputFile);
return listStart;
}
else {
errorMessage("File error", "Error opening the file for reading the TV guide", 0);
return NULL;
}
}
Run Code Online (Sandbox Code Playgroud) 在学校,我们正在学习如何在Visual Studio中使用c ++中的二进制文件.这段代码在Visual Studio 2005中完美运行,但在2010 - 2013版本中却没有.它给出了读取违规错误.所以我希望你们中的一个可以帮助我,因为即使我的老师也不知道什么是错的:(错误发生在阅读结束时.我尝试了不同的ifstream和ofstream方法,但没有成功.
我的代码:
#include <z:/Yoshi On My Mac/Google Drive/School/2013-2014/C-taal/headeryoshi.h>
#define B "z:/Yoshi On My Mac/Google Drive/city.dat"
typedef struct city {
string zip, name;
};
void add() {
ofstream file;
city city;
titelscherm("ADD CITY");
cout << "ZIP: ";
getline(cin, city.zip);
while (city.zip not_eq "0") {
cout << "Name: ";
getline(cin, city.name);
file.open(B, ios::app | ios::binary);
file.write((char*)&city, sizeof(city));
file.close();
titelscherm("ADD CITY");
cout << "POSTCODE: ";
getline(cin, city.zip);
}
cout << "city: ";
file.close();
}
void read() { …Run Code Online (Sandbox Code Playgroud)