我是c新手,我正在努力上网,吸收资源来帮助学习。
我从一个简单的命令提示符类型交易开始,即使这也给我带来了困难!我正在尽力学习指针,但这个想法对我来说很难掌握,所以这里是给我带来麻烦的代码。我希望这个麻烦代码的答案能帮助我了解指针的语法。
#include <stdio.h>
#include <stdlib.h>
#include "login.h"
#include "help.h"
#include <malloc.h>
main()
{
if(login()) /* Login runs fine. After the imported */
{ /*login code runs, it takes me to the main screen */
int prac; /* (printf("Type help for a list of commands")) i input*/
char inpt[255]; /* help, the imported help screen runs,then the core
int *ptr; /*dumps. oh and i know the malloc() syntax is wront*/
malloc(255) == ptr; /*that's just the last thing i tried before i posted*/
*ptr == printf("Continuing Program...\n\n");
printf("---Type Help For a List of Commands----\n");
gets(inpt);
if (strcmp(inpt, help) == 1)
{
help();
goto *ptr;
}
}
return 0;
}