首页
社区
课程
招聘
某公司笔试题目 求助
发表于: 2010-1-11 09:27 71088

某公司笔试题目 求助

2010-1-11 09:27
71088
收藏
免费 0
支持
分享
最新回复 (131)
雪    币: 40
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
101
挖坟啊
2012-10-9 16:34
0
雪    币: 274
活跃值: (30)
能力值: ( LV3,RANK:30 )
在线值:
发帖
回帖
粉丝
102
感觉类似于加壳呀
2012-10-20 16:59
0
雪    币: 230
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
103
这个问题,看上去很简单,但好像不是想像的那样,不过,公司笔试,需要这么深吗?
2012-10-20 17:39
0
雪    币: 38
活跃值: (11)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
104
为了给客户做软件嘛,用得着这样整人吗?
2012-10-20 19:09
0
雪    币: 673
活跃值: (278)
能力值: ( LV15,RANK:360 )
在线值:
发帖
回帖
粉丝
105
留个爪子 方便查询
2012-12-17 15:58
0
雪    币: 238
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
106
好问题啊,大家的思想让我学到了很多东西~
2013-1-17 15:30
0
雪    币: 62
活跃值: (27)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
107
这是一个程序链接问题,与编译环境有关系,一般熟悉执行文件格式(例如PE或是ELF)就不难。
2013-1-17 15:52
0
雪    币: 40
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
108
学习了函数指针及函数运行,牛了
2013-2-4 07:10
0
雪    币: 21
活跃值: (11)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
109
有意思的题目,开通大脑
2013-2-7 23:57
0
雪    币: 16
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
110
如果在vs2008里面用debug方式的话,下面这样就可以了
void print()
{   
               #pragma comment(linker, "/entry:print")
        printf ("i am MentalDease\n");
        getchar();

}

用release的话可以运行,但是看不到结果。如果在vcc6.0里面编译,就会提示“unresolved external symbol _main”,对入口函数只了解个大概,没有深入的了解过,看来必须一步一步反汇编看看。
2013-3-28 14:31
0
雪    币: 182
活跃值: (81)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
111
加个hello,world,然后把函数入口改了
2013-3-28 14:36
0
雪    币: 54
活跃值: (10)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
112
蛮难的,学习
2013-3-28 14:44
0
雪    币: 112
活跃值: (57)
能力值: ( LV12,RANK:200 )
在线值:
发帖
回帖
粉丝
113
当自定义了主程序入口点, 如果还需要调用原始main函数, 需要自己取参数.
否则argc和agrv是空的, 做了后续实验, 说明这种情况。
/// @file       SrcChangeMainProgEntry.cpp
/// @brief      用编译指示改变主程序入口点
///             VS2008控制台程序

#include "stdafx.h"
#include <windows.h>
#include <tchar.h>
#include <stdio.h>  ///< for getchar
#include <crtdbg.h> ///< for _ASSERT
#include <locale.h> ///< for LC_CTYPE

/// if we want to call original _tmain
/// please define CALL_MAIN_ORG
#define CALL_MAIN_ORG

int fnChangeProgEntry()
{
    int     iRc =   0;

    wchar_t szACP[_MAX_PATH];   ///< for unicode print

    /**
    You can either use /ENTRY:WinMain to override the default name, 
    or compile with /MT so the compiler will mark the object files in such a 
    way that the linker grabs the runtime library (which provides 
    an entry point).

    The runtime library entry point does some nice things like run global 
    constructors set up a global exception handler so you get a dialog box in 
    case of uncaught exceptions, but nothing it does is absolutely necessary.
    -------------------------------------------------------------------------

    NOTE: If you don't use the library entry point, no arguments are available
    . You have to use the OS functions such as GetCurrentProcess and 
    GetCommandLine and GetStartupInfo instead to get the information normally 
    available as WinMain arguments. You weren't using any of that anyway. 
    But think twice about using your own entry point, 
    a lot of stuff depends on the library initialization and you'd better be 
    very sure you aren't using it.
    */

#pragma comment(linker, "/entry:fnChangeProgEntry")

    _tprintf(L"Prog main Entry is fnChangeProgEntry\r\n");
    wsprintf(szACP, _T(".%d"), GetACP());
    _tsetlocale(LC_CTYPE, szACP);

#ifdef CALL_MAIN_ORG

    {
        int         iArgc       =   0;
        LPWSTR *    lpszArgv    =   NULL;

        lpszArgv = CommandLineToArgvW(GetCommandLineW(), &iArgc);

        /// forword declare
        int _tmain(int argc, _TCHAR* argv[]);
        iRc = _tmain(iArgc, lpszArgv);
        GlobalFree(lpszArgv); 

    }

#endif

    _tprintf(L"END, press any key to quit\r\n");

    /** run result

    on cmd line run : SrcChangeMainProgEntry.exe param1
    output below:

    Prog main Entry is fnChangeProgEntry
    >> _tmain
    argc = 2
    argv[0] = [SrcChangeMainProgEntry.exe]
    argv[1] = [param1]
    << _tmain
    END, press any key to quit
    */

    getchar();
    return iRc;
}

int _tmain(int argc, _TCHAR* argv[])
{
    int     iIndex  =   0;

    _tprintf(L">> _tmain\r\n");
    _tprintf(L"argc = %d\r\n", argc);

    for (iIndex = 0; iIndex < argc; iIndex++)
        _tprintf(L"argv[%d] = [%s]\r\n", iIndex, argv[iIndex]);

    _tprintf(L"<< _tmain\r\n");
	return 0;
}

2013-7-5 22:39
0
雪    币: 4
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
114
学习了,原来如此
2013-7-6 14:42
0
雪    币: 80
活跃值: (109)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
115
http://www.zystudios.cn/blog/post/37.Shtml
2013-7-6 14:47
0
雪    币: 3496
活跃值: (749)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
116
学习了,好贴 学习了,好贴!
2013-11-25 15:27
0
雪    币: 233
活跃值: (10)
能力值: ( LV4,RANK:40 )
在线值:
发帖
回帖
粉丝
117
#include "stdio.h"
void print()
{
        }
        void main()
        {
                printf("Hello World");
        }
        #define main a
        void fun(){

}

void main()
{
}
2013-11-25 18:29
0
雪    币: 61
活跃值: (11)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
118
利用宏实现是最简单的,print在main上面,就可以把main定义为任何宏所定义内容

void print()
{
    printf("hello world\n");

    #define main main(){print();} void null
}

void main()
{

}

宏解开后为下面代码:
-----------------------------------------
void print()
{
    printf("hello world\n");

   
}

void main(){print();} void null()
{

}
2013-12-6 02:29
0
雪    币: 137
活跃值: (13)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
119
学习了,这个真有意思。
2013-12-6 03:31
0
雪    币: 23
活跃值: (25)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
120
void print()
{
    #pragma comment(linker, "/entry:print")
    puts("HelloWorld!\n");
}

void main()
{

}
2013-12-6 08:56
0
雪    币: 100
活跃值: (26)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
121
mark 学习
2013-12-6 09:40
0
雪    币: 72
活跃值: (25)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
122
有人给出了这样的答案。。。

#include "stdio.h"

void print()
{
        printf("Hello world");} void main(){print();}/*
}

int main()
{
        return 0;
}
2013-12-6 10:43
0
雪    币: 89
活跃值: (75)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
123
#include <stdio.H>
void print()
{

}int main(){printf("hello world\n");
#define main m

}
int main()
{

}
2013-12-7 14:40
0
雪    币: 1
活跃值: (12)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
124
简单而深奥的题目!
2013-12-28 20:07
0
雪    币: 5
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
125
好题目啊

好题目,太支持了
2014-1-6 00:48
0
游客
登录 | 注册 方可回帖
返回
//