我有这个代码:
struct nod
{
nod *vCap;
int vCost;
char vInfo;
};
list<nod*> vList;
for (int i = 9; i >= 0; i--)
{
nod *vTmp;
vTmp->vCost=i;
vTmp->vInfo='a';
vList.push_back(vTmp);
}
Run Code Online (Sandbox Code Playgroud)
如何按vCost值对列表进行排序?
我有这个鳕鱼:
[Serializable]
public class testC
{
string sir;
public testC()
{
sir = string.Empty;
}
public string GetString
{
get { return sir; }
set { sir = value; }
}
}
public class cookieTest
{
testC test;
public cookieTest()
{
test = new testC();
}
public testC GetTestC
{
get
{
HttpCookie cookie = HttpContext.Current.Request.Cookies["test"];
test = cookie["first"] as testC;
return test;
}
set
{
HttpCookie cookie = new HttpCookie("test");
cookie.Expires = DateTime.Now.AddHours(8);
cookie["first"] = value.ToString();
System.Web.HttpContext.Current.Response.Cookies.Add(cookie);
}
} …Run Code Online (Sandbox Code Playgroud)