小编Nan*_* HE的帖子

美丽的胜利形式应用程序设计在c#

如何设计一个漂亮的win形式UI.(有点像MSN消息客户端)

我用Google搜索,无法找到开始我的befault win表单学习的方法.我是否想念一些C#win form design tech?我必须开始.net 3.5学习吗?

使用.net 2.0 vs2005.

c# winforms

9
推荐指数
2
解决办法
1万
查看次数

我的C书中有一个神奇的数字127

可能重复:
什么限制了c中嵌套循环的数量?

你好.

当我读到我的C书时,它说

Nesting for-Loop in C can continue even further up to 127 levels!
Run Code Online (Sandbox Code Playgroud)

怎么127来的?

我的书没有提到这一点.对我来说就像一个神奇的数字.

[更新]

int main()
{
    int number, n, triangularNumber, counter;

    triangularNumber = 0;

    for (counter = 1; counter <= 5; ++counter){
        printf("What triangular number do you want? \n");

        // using a routine called scanf
        scanf("%i", &number);


        triangularNumber = 0;

        for (n =1 ; n <= number; ++n)

            triangularNumber += n;

        printf("Triangular number %i is %i\n", number, triangularNumber);
    }
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

c for-loop nested c99

9
推荐指数
2
解决办法
1301
查看次数

打印列表项

List<string> list = new List<string>();    
        list.Add("A");
        list.Add("B");

List<string> list1 = new List<string>();    
        list.Add("a");
        list.Add("b");


    for (int i = 0; i < list.Count; i++)
    {
        // print another list items.
        for (int j = 0; j < list1.Count; j++)
        {
            Console.WriteLine("/" + list[i] + "/" + list1[j]);
        }

    }
Run Code Online (Sandbox Code Playgroud)

我想像这样编码string tmpS =+ list[i];加入下一个列表项togeter.

然后打印 tmpS

但编译错误CS0023:运算符'+'不能应用于'string'类型的操作数.

如何打印下面的所有项目.(任何种类都可以)

A A Ab Aab Aba AB ABa ABb ABab ABba B Ba Bb Bab Bba

(大写号码没有交换.小字符应该被交换.并且始终跟随大写号码附加小字符.)

c# data-structures

8
推荐指数
1
解决办法
9万
查看次数

如何重用StringBuilder obj?

据我所知,如果我宣布一个字典,我可以调用myDict.Clear()来重用目的.

现在,如果我宣布一个sb作为StingBuilder obj.

StringBuilder sb = new StringBuilder();
Run Code Online (Sandbox Code Playgroud)

如何重用某人?谢谢.

实际上我需要打印mainDict的所有可能条件.

像这样的sb表达式之一(包括在下面的代码中)

sb.AppendFormat("{0}/{1}/{2}/{3}, {4}", pair1.Key, pair2.Key, pair3.Key, pair4.Key, pair4.Value);
Console.WriteLine(sb.ToString());
Run Code Online (Sandbox Code Playgroud)

如果我声明了很多StringBuilder objs,我仍然无法检测到有多少obj对我来说已经足够了.实际上mainDict非常复杂.上面的代码只是一种做法.谢谢.


代码于04年1月更新.

using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;


class test
{
    private static Dictionary<string, object> mainDict = new Dictionary<string, object>();

    public static void Main()
    {
        Dictionary<string, object> aSubDict = new Dictionary<string,object>();
        Dictionary<string, object> aSub1Dict = new Dictionary<string, object>();
        Dictionary<string, object> aSub2Dict = new Dictionary<string, object>();
        Dictionary<string, object> aSub3Dict = new Dictionary<string, object>();
        Dictionary<string, object> aSub4Dict = new Dictionary<string, …
Run Code Online (Sandbox Code Playgroud)

c# stringbuilder

7
推荐指数
1
解决办法
4495
查看次数

Main的入口点错误(字符串args)?

使用系统; 使用System.Collections.Generic; 使用System.Text;

namespace MyConApp
{
    class Program
    {
        static void Main(string args) 
        {
            string tmpString; 
            tmpString = args;
            Console.WriteLine("Hello" + tmpString);
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

为什么下面的表达式显示编译错误消息"不包含适用于入口点的静态'Main'方法"

namespace MyConApp
{
    class Program
    {
        static void Main(string args) 
        {
            string tmpString; 
            tmpString = args;
            Console.WriteLine("Hello" + tmpString);
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

谢谢.

c# syntax

7
推荐指数
3
解决办法
1万
查看次数

scanf()(C语言)让我困惑

我什么时候需要插入/不插入&scanf()用C?谢谢.

int main()
{
    char s1[81], s2[81], s3[81];

    scanf("%s%s%s", s1, s2, s3);

    // If replace scanf() with the expression below, it works too.
    // scanf("%s%s%s", &s1, &s2, &s3);

    printf("\ns1 = %s\ns2 = %s\ns3 = %s", s1, s2, s3);

    return 0;
}

//programming is fun
//
//s1 = programming
//s2 = is
//s3 = fun
Run Code Online (Sandbox Code Playgroud)

c scanf

6
推荐指数
2
解决办法
1605
查看次数

如何为复杂词典增加价值?

据我所知,为字典添加值的方法如下.

    Dictionary<string, string> myDict = new Dictionary<string, string>();

    myDict.Add("a", "1");
Run Code Online (Sandbox Code Playgroud)

如果我将"myDictDict"声明为下面的样式.

IDictionary<string, Dictionary<string, string>> myDictDict = new Dictionary<string, Dictionary<string, string>>();

myDictDict .Add("hello", "tom","cat"); ?// How to add value here.
Run Code Online (Sandbox Code Playgroud)

谢谢.

c# dictionary

5
推荐指数
2
解决办法
6708
查看次数

我打印Perl哈希时决定键的顺序是什么?

activePerl 5.8基于

#!C:\Perl\bin\perl.exe
use strict;
use warnings;

# declare a new hash
my %some_hash;

%some_hash = ("foo", 35, "bar", 12.4, 2.5, "hello",
      "wilma", 1.72e30, "betty", "bye\n");

my @any_array;
@any_array = %some_hash;

print %some_hash;
print "\n";
print @any_array;
print "\n";
print $any_array[0];
print "\n";
print $any_array[1];
print "\n";
print $any_array[2];
print "\n";
print $any_array[3];
print "\n";
print $any_array[4];
print "\n";
print $any_array[5];
print "\n";
print $any_array[6];
print "\n";
print $any_array[7];
print "\n";
print $any_array[8];
print "\n";
print $any_array[9];
Run Code Online (Sandbox Code Playgroud)

输出为此

D:\learning\perl>test.pl
bettybye …
Run Code Online (Sandbox Code Playgroud)

perl hash

5
推荐指数
2
解决办法
1万
查看次数

如何监控Perl调用堆栈?

我在Windows XP上使用ActivePerl 5.8.

use strict;
use warnings;
use Data::Dumper;
Run Code Online (Sandbox Code Playgroud)

我的脚本中使用了三个子例程.

要检测调用堆栈,我只能插入一些print "some location";并从控制台窗口检查打印结果.

有什么好方法可以监控它吗?谢谢.

perl callstack

5
推荐指数
3
解决办法
2102
查看次数

VS2010中的字体设置 - 缺少FixedSys

昨天安装VS2010后 - (安装了VS2005和VS2010),我找不到字体和颜色 - >字体(下拉列表)中的" FixedSys "样式字体.

我仍然可以在VS2005中使用该字体.

[更新]我刚搜索"C:\ WINDOWS\Fonts",文件夹中没有Fixedsys样式.

有关如何在Visual Studio 2010中选择使用FixedSys的任何建议吗?

fonts visual-studio-2010

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