uninitialized local variables!

Here is my code: int main(void) { int i; Coords** latLng; Quadrado* q1; latLng[0] = AdicionaValores(latLng[0],-23.000490,-43.346687); latLng[1] = AdicionaValores(latLng[1],-22.988243,-43.342224); q1 = AdicionaValoresQuadrado(q1,-23.000490,-43.346687,-22.988243,-43.342224); printf("# Connecting to database.\n"); for(i=0;i<2;i++) { if(clientInside(q1, latLng[i])) printf("Dentro"); else printf("Fora"); } system("PAUSE"); } Here is AdicionaValores and AdicionaValoresQuadrado: Coords* AdicionaValores(Coords* v, double x, double y) { v = (Coords*) malloc(sizeof(Coords)); v->x = x; v->y = y; return v; } Quadrado* AdicionaValoresQuadrado(Quadrado* q, double x1, double y1, double x2, double y2) { q = (Quadrado*) malloc(sizeof(Quadrado)); q->x1 = x1; q->x2 = x2; q->y1 = y1; q->y2 = y2; return q; } it compiles just fine with 2 warnings, telling me that latLng and q1 are uninitialized! what should I do ?? malloc them on main ? help!

以上就是uninitialized local variables!的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » CSS3 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏