我正试图在c中产生锯齿波.我已经接近我的工作,但我有一个必须解决的问题.我在下面附上了clode.
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <tgmath.h>
/******************************
* Magic file format strings. *
******************************/
const char fChunkID[] = {'R', 'I', 'F', 'F'};
const char fFormat[] = {'W', 'A', 'V', 'E'};
const char fSubchunk1ID[] = {'f', 'm', 't', ' '};
const char fSubchunk2ID[] = {'d', 'a', 't', 'a'};
/********************************
* WriteWavePCM() configuration: *
* - 2 channels, *
* - frequency 44100 Hz. *
********************************/
const unsigned short N_CHANNELS = 2;
const unsigned int SAMPLE_RATE = 48000;
const …Run Code Online (Sandbox Code Playgroud) 我有一些问题WM_COMMAND.
是否可以x在case分支中更改变量以在case分支中WM_COMMAND获取此新值WM_LBUTTONDOWN?我总是0在WM_LBUTTONDOWN分支1在WM_COMMAND分支.
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int x = 0;
switch (message)
{
case WM_CREATE:
break;
case WM_COMMAND:
x = 1;
cout << x;
break;
case WM_LBUTTONDOWN:
cout << x;
break;
case WM_DESTROY:
PostQuitMessage (0); /* send a WM_QUIT to the message queue */
break;
default: /* for messages that we don't deal with */
return …Run Code Online (Sandbox Code Playgroud)