- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试制作一个使用各种功能的 C 程序,然后通过连接到 LPCXpresso 1769 的 DIP 开关,它必须选择要执行的功能(例如 00 二进制计数器 01 旋转 LED 等)。现在,我已经做到了,但想将选择要执行的程序的函数从嵌套 if 更改为 switch 语句,但它不起作用。它确实可以编译,但是,调试器会抛出一些警告(第 123 行和第 132 行的“没有效果的语句”以及第 100 行的“未使用的参数 pvParameter”),以及在将其刷新到 LPCXpresso 并为每个任务选择组合之后什么都不做。我正在使用 NXP 的 LPCXpresso IDE。
这是代码
#include <string.h>
#include "FreeRTOS.h"
#include "task.h"
#ifdef __USE_CMSIS
#include "LPC17xx.h"
#endif
#include <cr_section_macros.h>
#include <NXP/crp.h>
#include "lpc17xx_gpio.h"
#include "lpc17xx_timer.h"
#include "lpc17xx_adc.h"
#include "lpc17xx_pinsel.h"
/* Library includes. */
#include "LPC17xx.h"
#include "LPC17xx_gpio.h"
#include "system_LPC17xx.h"
/* Used as a loop counter to create a very crude delay. */
IRQn_Type TIMER0;
__CRP const unsigned int CRP_WORD = CRP_NO_CRP ;
/* Used in the run time stats calculations. */
/* Used in the run time stats calculations. */
static uint32_t ulClocksPer10thOfAMilliSecond = 0UL;
#define mainDELAY_LOOP_COUNT (0xfffff)
void CONFIG_GPIO(void);
static void init_adc(void);
extern int Timer0_Wait();
#define RGB_RED 0x01000000
#define RGB_BLUE 0x02000000
#define RGB_GREEN 0x04000000
void init_rgb (void);
void counter_rgb (void);
void vTaskKit( void *pvParameters );
int main( void )
{
init_adc();
init_rgb();
CONFIG_GPIO();
xTaskCreate (vTaskKit, "Kit", 240, NULL, 1, NULL );
/* Start the FreeRTOS scheduler. */
vTaskStartScheduler();
/* The following line should never execute. If it does, it means there was
insufficient FreeRTOS heap memory available to create the Idle and/or timer
tasks. See the memory management section on the http://www.FreeRTOS.org web
site for more information. */
for( ;; );
}
/*-----------------------------------------------------------*/
void CONFIG_GPIO(void)
{
GPIO_SetDir(0,0x000000FF, 1);
GPIO_ClearValue(0, 0x000000FF);
GPIO_SetDir(2,0x000000FF,0);
GPIO_ClearValue(2, 0x000000FF);
}
void init_rgb (void)
{
GPIO_SetDir (0,0x01000000, 1);
GPIO_SetDir (0,0x02000000, 1);
GPIO_SetDir (0,0x04000000, 1);
}
static void init_adc(void)
{
/*
* Init ADC pin connect
* AD0.0 on P0.23
*/
PINSEL_CFG_Type PinCfg;
PinCfg.Funcnum = 1;
PinCfg.OpenDrain = 0;
PinCfg.Pinmode = 0;
PinCfg.Pinnum = 23;
PinCfg.Portnum = 0;
PINSEL_ConfigPin(&PinCfg);
/* Configuration for ADC :
* Frequency at 1Mhz
* ADC channel 0, no Interrupt
*/
ADC_Init(LPC_ADC, 100000);
ADC_IntConfig(LPC_ADC,ADC_ADINTEN0,ENABLE);
ADC_ChannelCmd(LPC_ADC,ADC_CHANNEL_0,ENABLE);
ADC_EdgeStartConfig(LPC_ADC,ADC_START_ON_FALLING);
}
void vTaskKit( void *pvParameters )
{
volatile unsigned long ul;
uint32_t var1=0x00000001;
uint32_t del =0x000000FF;
uint32_t var2=0x00000001;
uint32_t analog = 0;
uint32_t sw=0x00000000;
unsigned int var=0;
while(1)
{
sw=GPIO_ReadValue(2);
switch(sw)
{
case 0x00000001://Contador Binario
GPIO_SetValue(0,var);
var++;
vTaskDelay(100);
GPIO_ClearValue(0,0x000000FF);
break;
case 0x00000002://Auto Increible
for(var2;var2<=7;var2++)
{
GPIO_SetValue(0,var1);
var1= var1<<1;
for (ul =0; ul < mainDELAY_LOOP_COUNT; ul++ )
{
}
GPIO_ClearValue(0,del);
}
for(var2;var2>=2;var2--)
{
GPIO_SetValue(0,var1);
var1= var1>>1;
for (ul =0; ul < mainDELAY_LOOP_COUNT; ul++ )
{
}
GPIO_ClearValue(0,del);
}
break;
case 0x00000003://Contador RGB
GPIO_SetValue (0,RGB_RED);
vTaskDelay( 200 / portTICK_RATE_MS );
GPIO_ClearValue (0,RGB_RED);
GPIO_SetValue (0,RGB_BLUE);
vTaskDelay( 200 / portTICK_RATE_MS );
GPIO_ClearValue (0,RGB_BLUE);
GPIO_SetValue (0,(RGB_RED+RGB_BLUE));
vTaskDelay( 200 / portTICK_RATE_MS );
GPIO_ClearValue (0,(RGB_RED+RGB_BLUE));
GPIO_SetValue (0,RGB_GREEN);
vTaskDelay( 200 / portTICK_RATE_MS );
GPIO_ClearValue (0,RGB_GREEN);
GPIO_SetValue (0,RGB_GREEN+RGB_RED);
vTaskDelay( 200 / portTICK_RATE_MS );
GPIO_ClearValue (0,RGB_GREEN+RGB_RED);
GPIO_SetValue (0,RGB_GREEN+RGB_BLUE);
vTaskDelay( 200 / portTICK_RATE_MS );
GPIO_ClearValue (0,RGB_GREEN+RGB_BLUE);
GPIO_SetValue (0,RGB_GREEN+RGB_BLUE+RGB_RED);
vTaskDelay( 200 / portTICK_RATE_MS );
GPIO_ClearValue (0,RGB_GREEN+RGB_BLUE+RGB_RED);
vTaskDelay( 200 / portTICK_RATE_MS );
break;
case 0x00000004://Contador ADC Binario
ADC_StartCmd(LPC_ADC,ADC_START_NOW);
analog=ADC_ChannelGetData(LPC_ADC,ADC_CHANNEL_0);
analog=analog/16;
GPIO_SetValue(0,analog);
vTaskDelay( 100 / portTICK_RATE_MS );
GPIO_ClearValue(0,0x000000FF);
break;
case 0x00000005://Contador ADC RGB
ADC_StartCmd(LPC_ADC,ADC_START_NOW);
analog=ADC_ChannelGetData(LPC_ADC,ADC_CHANNEL_0);
if(analog<585)
{
GPIO_SetValue(0,RGB_RED);
vTaskDelay( 50 / portTICK_RATE_MS );
GPIO_ClearValue (0,RGB_RED);
}
if(585<analog && analog<1170)
{
GPIO_SetValue (0,RGB_BLUE);
vTaskDelay( 50 / portTICK_RATE_MS );
GPIO_ClearValue (0,RGB_BLUE);
}
if(1170<analog && analog<1755)
{
GPIO_SetValue (0,(RGB_RED+RGB_BLUE));
vTaskDelay( 50 / portTICK_RATE_MS );
GPIO_ClearValue (0,(RGB_RED+RGB_BLUE));
}
if(1755<analog && analog<2340)
{
GPIO_SetValue (0,RGB_GREEN);
vTaskDelay( 50 / portTICK_RATE_MS );
GPIO_ClearValue (0,RGB_GREEN);
}
if(2340<analog && analog<2925)
{
GPIO_SetValue (0,RGB_GREEN+RGB_RED);
vTaskDelay( 50 / portTICK_RATE_MS );
GPIO_ClearValue (0,RGB_GREEN+RGB_RED);
}
if(2925<analog && analog<3510)
{
GPIO_SetValue (0,RGB_GREEN+RGB_BLUE);
vTaskDelay( 50 / portTICK_RATE_MS );
GPIO_ClearValue (0,RGB_GREEN+RGB_BLUE);
}
if(3510<analog && analog<4095)
{
GPIO_SetValue (0,RGB_GREEN+RGB_BLUE+RGB_RED);
vTaskDelay( 50 / portTICK_RATE_MS );
GPIO_ClearValue (0,RGB_GREEN+RGB_BLUE+RGB_RED);
}
break;
}
}
}
void vMainConfigureTimerForRunTimeStats( void )
{
/* How many clocks are there per tenth of a millisecond? */
ulClocksPer10thOfAMilliSecond = configCPU_CLOCK_HZ / 10000UL;
}
/*-----------------------------------------------------------*/
uint32_t ulMainGetRunTimeCounterValue( void )
{
uint32_t ulSysTickCounts, ulTickCount, ulReturn;
const uint32_t ulSysTickReloadValue = ( configCPU_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL;
volatile uint32_t * const pulCurrentSysTickCount = ( ( volatile uint32_t *) 0xe000e018 );
volatile uint32_t * const pulInterruptCTRLState = ( ( volatile uint32_t *) 0xe000ed04 );
const uint32_t ulSysTickPendingBit = 0x04000000UL;
/* NOTE: There are potentially race conditions here. However, it is used
anyway to keep the examples simple, and to avoid reliance on a separate
timer peripheral. */
/* The SysTick is a down counter. How many clocks have passed since it was
last reloaded? */
ulSysTickCounts = ulSysTickReloadValue - *pulCurrentSysTickCount;
/* How many times has it overflowed? */
ulTickCount = xTaskGetTickCountFromISR();
/* Is there a SysTick interrupt pending? */
if( ( *pulInterruptCTRLState & ulSysTickPendingBit ) != 0UL )
{
/* There is a SysTick interrupt pending, so the SysTick has overflowed
but the tick count not yet incremented. */
ulTickCount++;
/* Read the SysTick again, as the overflow might have occurred since
it was read last. */
ulSysTickCounts = ulSysTickReloadValue - *pulCurrentSysTickCount;
}
/* Convert the tick count into tenths of a millisecond. THIS ASSUMES
configTICK_RATE_HZ is 1000! */
ulReturn = ( ulTickCount * 10UL ) ;
/* Add on the number of tenths of a millisecond that have passed since the
tick count last got updated. */
ulReturn += ( ulSysTickCounts / ulClocksPer10thOfAMilliSecond );
return ulReturn;
}
/*-----------------------------------------------------------*/
void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName )
{
( void ) pcTaskName;
( void ) pxTask;
/* Run time stack overflow checking is performed if
configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook
function is called if a stack overflow is detected. */
taskDISABLE_INTERRUPTS();
for( ;; );
}
/*-----------------------------------------------------------*/
void vApplicationMallocFailedHook( void )
{
/* vApplicationMallocFailedHook() will only be called if
configUSE_MALLOC_FAILED_HOOK is set to 1 in FreeRTOSConfig.h. It is a hook
function that will get called if a call to pvPortMalloc() fails.
pvPortMalloc() is called internally by the kernel whenever a task, queue,
timer or semaphore is created. It is also called by various parts of the
demo application. If heap_1.c or heap_2.c are used, then the size of the
heap available to pvPortMalloc() is defined by configTOTAL_HEAP_SIZE in
FreeRTOSConfig.h, and the xPortGetFreeHeapSize() API function can be used
to query the size of free heap space that remains (although it does not
provide information on how the remaining heap might be fragmented). */
taskDISABLE_INTERRUPTS();
for( ;; );
}
/*-----------------------------------------------------------*/
还有一个可以工作的,但是带有嵌套的 if
#include <string.h>
#include "FreeRTOS.h"
#include "task.h"
#ifdef __USE_CMSIS
#include "LPC17xx.h"
#endif
#include <cr_section_macros.h>
#include <NXP/crp.h>
#include "lpc17xx_gpio.h"
#include "lpc17xx_timer.h"
#include "lpc17xx_adc.h"
#include "lpc17xx_pinsel.h"
/* Library includes. */
#include "LPC17xx.h"
#include "LPC17xx_gpio.h"
#include "system_LPC17xx.h"
/* Used as a loop counter to create a very crude delay. */
IRQn_Type TIMER0;
__CRP const unsigned int CRP_WORD = CRP_NO_CRP ;
/* Used in the run time stats calculations. */
/* Used in the run time stats calculations. */
static uint32_t ulClocksPer10thOfAMilliSecond = 0UL;
#define mainDELAY_LOOP_COUNT (0xfffff)
void CONFIG_GPIO(void);
static void init_adc(void);
extern int Timer0_Wait();
#define RGB_RED 0x01000000
#define RGB_BLUE 0x02000000
#define RGB_GREEN 0x04000000
void init_rgb (void);
void counter_rgb (void);
void vTaskKit( void *pvParameters );
int main( void )
{
init_adc();
init_rgb();
CONFIG_GPIO();
xTaskCreate (vTaskKit, "Kit", 240, NULL, 1, NULL );
/* Start the FreeRTOS scheduler. */
vTaskStartScheduler();
/* The following line should never execute. If it does, it means there was
insufficient FreeRTOS heap memory available to create the Idle and/or timer
tasks. See the memory management section on the http://www.FreeRTOS.org web
site for more information. */
for( ;; );
}
/*-----------------------------------------------------------*/
void CONFIG_GPIO(void)
{
GPIO_SetDir(0,0x000000FF, 1);
GPIO_ClearValue(0, 0x000000FF);
GPIO_SetDir(2,0x000000FF,0);
GPIO_ClearValue(2, 0x000000FF);
}
void init_rgb (void)
{
GPIO_SetDir (0,0x01000000, 1);
GPIO_SetDir (0,0x02000000, 1);
GPIO_SetDir (0,0x04000000, 1);
}
static void init_adc(void)
{
/*
* Init ADC pin connect
* AD0.0 on P0.23
*/
PINSEL_CFG_Type PinCfg;
PinCfg.Funcnum = 1;
PinCfg.OpenDrain = 0;
PinCfg.Pinmode = 0;
PinCfg.Pinnum = 23;
PinCfg.Portnum = 0;
PINSEL_ConfigPin(&PinCfg);
/* Configuration for ADC :
* Frequency at 1Mhz
* ADC channel 0, no Interrupt
*/
ADC_Init(LPC_ADC, 100000);
ADC_IntConfig(LPC_ADC,ADC_ADINTEN0,ENABLE);
ADC_ChannelCmd(LPC_ADC,ADC_CHANNEL_0,ENABLE);
ADC_EdgeStartConfig(LPC_ADC,ADC_START_ON_FALLING);
}
void vTaskKit( void *pvParameters )
{
volatile unsigned long ul;
uint32_t var1=0x00000001;
uint32_t del =0x000000FF;
uint32_t var2=0x00000001;
uint32_t analog = 0;
char var=0;
char sw=0x000000000;
char bin=0x00000001;
char inc=0x00000002;
char rgb=0x00000003;
char adcbin=0x00000004;
char adcrgb=0x00000005;
while(1)
{
sw=GPIO_ReadValue(2);
if(sw==bin)
{
GPIO_SetValue(0,var);
var++;
vTaskDelay(100);
GPIO_ClearValue(0,0x000000FF);
}
if(sw==inc)
{
for(var2;var2<=7;var2++)
{
GPIO_SetValue(0,var1);
var1= var1<<1;
for (ul =0; ul < mainDELAY_LOOP_COUNT; ul++ )
{
}
GPIO_ClearValue(0,del);
}
for(var2;var2>=2;var2--)
{
GPIO_SetValue(0,var1);
var1= var1>>1;
for (ul =0; ul < mainDELAY_LOOP_COUNT; ul++ )
{
}
GPIO_ClearValue(0,del);
}
}
if(sw==rgb)
{
GPIO_SetValue (0,RGB_RED);
vTaskDelay( 200 / portTICK_RATE_MS );
GPIO_ClearValue (0,RGB_RED);
GPIO_SetValue (0,RGB_BLUE);
vTaskDelay( 200 / portTICK_RATE_MS );
GPIO_ClearValue (0,RGB_BLUE);
GPIO_SetValue (0,(RGB_RED+RGB_BLUE));
vTaskDelay( 200 / portTICK_RATE_MS );
GPIO_ClearValue (0,(RGB_RED+RGB_BLUE));
GPIO_SetValue (0,RGB_GREEN);
vTaskDelay( 200 / portTICK_RATE_MS );
GPIO_ClearValue (0,RGB_GREEN);
GPIO_SetValue (0,RGB_GREEN+RGB_RED);
vTaskDelay( 200 / portTICK_RATE_MS );
GPIO_ClearValue (0,RGB_GREEN+RGB_RED);
GPIO_SetValue (0,RGB_GREEN+RGB_BLUE);
vTaskDelay( 200 / portTICK_RATE_MS );
GPIO_ClearValue (0,RGB_GREEN+RGB_BLUE);
GPIO_SetValue (0,RGB_GREEN+RGB_BLUE+RGB_RED);
vTaskDelay( 200 / portTICK_RATE_MS );
GPIO_ClearValue (0,RGB_GREEN+RGB_BLUE+RGB_RED);
vTaskDelay( 200 / portTICK_RATE_MS );
}
if(sw==adcbin)
{
ADC_StartCmd(LPC_ADC,ADC_START_NOW);
analog=ADC_ChannelGetData(LPC_ADC,ADC_CHANNEL_0);
analog=analog/16;
GPIO_SetValue(0,analog);
vTaskDelay( 100 / portTICK_RATE_MS );
GPIO_ClearValue(0,0x000000FF);
}
if(sw==adcrgb)
{
ADC_StartCmd(LPC_ADC,ADC_START_NOW);
analog=ADC_ChannelGetData(LPC_ADC,ADC_CHANNEL_0);
if(analog<585)
{
GPIO_SetValue(0,RGB_RED);
vTaskDelay( 50 / portTICK_RATE_MS );
GPIO_ClearValue (0,RGB_RED);
}
if(585<analog && analog<1170)
{
GPIO_SetValue (0,RGB_BLUE);
vTaskDelay( 50 / portTICK_RATE_MS );
GPIO_ClearValue (0,RGB_BLUE);
}
if(1170<analog && analog<1755)
{
GPIO_SetValue (0,(RGB_RED+RGB_BLUE));
vTaskDelay( 50 / portTICK_RATE_MS );
GPIO_ClearValue (0,(RGB_RED+RGB_BLUE));
}
if(1755<analog && analog<2340)
{
GPIO_SetValue (0,RGB_GREEN);
vTaskDelay( 50 / portTICK_RATE_MS );
GPIO_ClearValue (0,RGB_GREEN);
}
if(2340<analog && analog<2925)
{
GPIO_SetValue (0,RGB_GREEN+RGB_RED);
vTaskDelay( 50 / portTICK_RATE_MS );
GPIO_ClearValue (0,RGB_GREEN+RGB_RED);
}
if(2925<analog && analog<3510)
{
GPIO_SetValue (0,RGB_GREEN+RGB_BLUE);
vTaskDelay( 50 / portTICK_RATE_MS );
GPIO_ClearValue (0,RGB_GREEN+RGB_BLUE);
}
if(3510<analog && analog<4095)
{
GPIO_SetValue
(0,RGB_GREEN+RGB_BLUE+RGB_RED);
vTaskDelay( 50 / portTICK_RATE_MS );
GPIO_ClearValue
(0,RGB_GREEN+RGB_BLUE+RGB_RED);
}
}
}
}
void vMainConfigureTimerForRunTimeStats( void )
{
/* How many clocks are there per tenth of a millisecond? */
ulClocksPer10thOfAMilliSecond = configCPU_CLOCK_HZ / 10000UL;
}
/*-----------------------------------------------------------*/
uint32_t ulMainGetRunTimeCounterValue( void )
{
uint32_t ulSysTickCounts, ulTickCount, ulReturn;
const uint32_t ulSysTickReloadValue = ( configCPU_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL;
volatile uint32_t * const pulCurrentSysTickCount = ( ( volatile uint32_t *) 0xe000e018 );
volatile uint32_t * const pulInterruptCTRLState = ( ( volatile uint32_t *) 0xe000ed04 );
const uint32_t ulSysTickPendingBit = 0x04000000UL;
/* NOTE: There are potentially race conditions here. However, it is used
anyway to keep the examples simple, and to avoid reliance on a separate
timer peripheral. */
/* The SysTick is a down counter. How many clocks have passed since it was
last reloaded? */
ulSysTickCounts = ulSysTickReloadValue - *pulCurrentSysTickCount;
/* How many times has it overflowed? */
ulTickCount = xTaskGetTickCountFromISR();
/* Is there a SysTick interrupt pending? */
if( ( *pulInterruptCTRLState & ulSysTickPendingBit ) != 0UL )
{
/* There is a SysTick interrupt pending, so the SysTick has overflowed
but the tick count not yet incremented. */
ulTickCount++;
/* Read the SysTick again, as the overflow might have occurred since
it was read last. */
ulSysTickCounts = ulSysTickReloadValue - *pulCurrentSysTickCount;
}
/* Convert the tick count into tenths of a millisecond. THIS ASSUMES
configTICK_RATE_HZ is 1000! */
ulReturn = ( ulTickCount * 10UL ) ;
/* Add on the number of tenths of a millisecond that have passed since the
tick count last got updated. */
ulReturn += ( ulSysTickCounts / ulClocksPer10thOfAMilliSecond );
return ulReturn;
}
/*-----------------------------------------------------------*/
void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName )
{
( void ) pcTaskName;
( void ) pxTask;
/* Run time stack overflow checking is performed if
configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook
function is called if a stack overflow is detected. */
taskDISABLE_INTERRUPTS();
for( ;; );
}
/*-----------------------------------------------------------*/
void vApplicationMallocFailedHook( void )
{
/* vApplicationMallocFailedHook() will only be called if
configUSE_MALLOC_FAILED_HOOK is set to 1 in FreeRTOSConfig.h. It is a hook
function that will get called if a call to pvPortMalloc() fails.
pvPortMalloc() is called internally by the kernel whenever a task, queue,
timer or semaphore is created. It is also called by various parts of the
demo application. If heap_1.c or heap_2.c are used, then the size of the
heap available to pvPortMalloc() is defined by configTOTAL_HEAP_SIZE in
FreeRTOSConfig.h, and the xPortGetFreeHeapSize() API function can be used
to query the size of free heap space that remains (although it does not
provide information on how the remaining heap might be fragmented). */
taskDISABLE_INTERRUPTS();
for( ;; );
}
/*-----------------------------------------------------------*/
最佳答案
引用未使用的参数警告:实现 FreeRTOS tasks 的函数必须具有相同的原型(prototype),并且原型(prototype)包含一个参数。但是,并非所有任务实际上都想使用该参数,但如果该参数未使用,编译器将生成您看到的警告。该警告是良性的,您无法通过删除参数来修复它,因此为了保持编译器安静,只需通过将以下代码添加到任务来执行参数的无效读取:
/* 删除有关未使用参数的编译器警告。 */( void ) pv参数;
Ref 语句对第 123 行没有影响。无法发表评论,因为我不知道哪一行是第 123 行。
关于C Switch 语句 CMSIS FreeRTOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42405789/
#include using namespace std; class C{ private: int value; public: C(){ value = 0;
这个问题已经有答案了: What is the difference between char a[] = ?string?; and char *p = ?string?;? (8 个回答) 已关闭
关闭。此题需要details or clarity 。目前不接受答案。 想要改进这个问题吗?通过 editing this post 添加详细信息并澄清问题. 已关闭 7 年前。 此帖子已于 8 个月
除了调试之外,是否有任何针对 c、c++ 或 c# 的测试工具,其工作原理类似于将独立函数复制粘贴到某个文本框,然后在其他文本框中输入参数? 最佳答案 也许您会考虑单元测试。我推荐你谷歌测试和谷歌模拟
我想在第二台显示器中移动一个窗口 (HWND)。问题是我尝试了很多方法,例如将分辨率加倍或输入负值,但它永远无法将窗口放在我的第二台显示器上。 关于如何在 C/C++/c# 中执行此操作的任何线索 最
我正在寻找 C/C++/C## 中不同类型 DES 的现有实现。我的运行平台是Windows XP/Vista/7。 我正在尝试编写一个 C# 程序,它将使用 DES 算法进行加密和解密。我需要一些实
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 1
有没有办法强制将另一个 窗口置于顶部? 不是应用程序的窗口,而是另一个已经在系统上运行的窗口。 (Windows, C/C++/C#) 最佳答案 SetWindowPos(that_window_ha
假设您可以在 C/C++ 或 Csharp 之间做出选择,并且您打算在 Windows 和 Linux 服务器上运行同一服务器的多个实例,那么构建套接字服务器应用程序的最明智选择是什么? 最佳答案 如
你们能告诉我它们之间的区别吗? 顺便问一下,有什么叫C++库或C库的吗? 最佳答案 C++ 标准库 和 C 标准库 是 C++ 和 C 标准定义的库,提供给 C++ 和 C 程序使用。那是那些词的共同
下面的测试代码,我将输出信息放在注释中。我使用的是 gcc 4.8.5 和 Centos 7.2。 #include #include class C { public:
很难说出这里问的是什么。这个问题是含糊的、模糊的、不完整的、过于宽泛的或修辞性的,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开它,visit the help center 。 已关
我的客户将使用名为 annoucement 的结构/类与客户通信。我想我会用 C++ 编写服务器。会有很多不同的类继承annoucement。我的问题是通过网络将这些类发送给客户端 我想也许我应该使用
我在 C# 中有以下函数: public Matrix ConcatDescriptors(IList> descriptors) { int cols = descriptors[0].Co
我有一个项目要编写一个函数来对某些数据执行某些操作。我可以用 C/C++ 编写代码,但我不想与雇主共享该函数的代码。相反,我只想让他有权在他自己的代码中调用该函数。是否可以?我想到了这两种方法 - 在
我使用的是编写糟糕的第 3 方 (C/C++) Api。我从托管代码(C++/CLI)中使用它。有时会出现“访问冲突错误”。这使整个应用程序崩溃。我知道我无法处理这些错误[如果指针访问非法内存位置等,
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以便用事实和引用来回答。 关闭 7 年前。
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是偏离主题的,因为
我有一些 C 代码,将使用 P/Invoke 从 C# 调用。我正在尝试为这个 C 函数定义一个 C# 等效项。 SomeData* DoSomething(); struct SomeData {
这个问题已经有答案了: Why are these constructs using pre and post-increment undefined behavior? (14 个回答) 已关闭 6
我是一名优秀的程序员,十分优秀!