已知直线的两个点坐标,和需要获取中间点的个数,获取各个点的坐标.
如图是获取4个点的坐标,算法需要可以指定任意点数.
解决方案
40
x1=x0+d *cos(a)
y1=y0+d*sin(a)
40
(X0,Y0)-(X1,Y1),t=0.2,0.4,0.6,0.8
Xt=X0*t+X1*(1-t)
Yt=Y0*t+Y1*(1-t)
……继续阅读 »
9年前 (2016-05-04) 1324浏览
0个赞
#include <stdio.h>
#include <stdlib.h>
#include “malloc.h”
typedef struct Linknode
{
int data;
struct Linknode *pNext;
}node,*List;
List addback(List phead,……继续阅读 »
9年前 (2016-05-04) 977浏览
0个赞
static char * rmSpace(const char * str) {
int spaceCnt = 0;
char * head = str;
while ((*str) != "\0") {
if (isspace(*str))
spaceCnt++;
str++;
}
str = head;
int resLen……继续阅读 »
9年前 (2016-05-04) 987浏览
0个赞
本人本人想了一个,不对。具体情况看图,讨教为什么不对,谢谢:)
解决方案
25
=是赋值运算符
==才是比较运算符
25
int count (const char *str) {
int ret = 0 ;
int state = 0 ;
for (int i = 0 ; str[i] != "#" ; i++) {
if (state =……继续阅读 »
9年前 (2016-05-04) 1323浏览
0个赞
使用debug as 进入debug 模式,但是断点没起作用 如图断点,debug运行直接把界面显示出来了
解决方案
20
真机调试的话,可能需要在开发者选项里设置一下。
20
同意楼上,需要在开发者选项中,开启调试模式
……继续阅读 »
9年前 (2016-05-04) 1244浏览
0个赞
typedef struct student{
int stud_number;
char stud_name[20];
}stud;
typedef std:vector<stud> studentVector;
int main(){
stud jourdon={01,”Jourdon”};
stud mary={02……继续阅读 »
9年前 (2016-05-04) 3521浏览
0个赞
shared_ptr<int> sp(new int());
int* p=sp.get();
sp.reset();
这样貌似p还是会被释放.
解决方案
40
shared_ptr 是要被多处共享的,在最后一个释放后释放。这样拿一个 raw pointer 出来是要干什么?貌似与 share_ptr 语义不符,是不是应该考虑换一个 ………继续阅读 »
9年前 (2016-05-04) 1052浏览
0个赞
#include <exportfuncs.h>
#include <triangleapi.h>
#include "surface.h"
#include "loadimage.h"
cl_enginefunc_t gEngfuncs;
int g_iTexWidth, g_iTexHeight;
int g_iTexID;
i……继续阅读 »
9年前 (2016-05-04) 1513浏览
0个赞
如题!想在线程类外的静态函数中触发一个线程中的信号,不知有什么办法实现。请高手帮看看。谢谢!
解决方案
20
static void Func(ClassA* p)
{
...
emit p->SomeSignal();
}
这样?
……继续阅读 »
9年前 (2016-05-04) 1777浏览
0个赞