小编pic*_*and的帖子

错误:'unary*'的无效类型参数(有'int')

我有一个C程序:

#include <stdio.h>
int main(){
  int b = 10;             //assign the integer 10 to variable 'b'

  int *a;                 //declare a pointer to an integer 'a'

  a=(int *)&b;            //Get the memory location of variable 'b' cast it
                          //to an int pointer and assign it to pointer 'a'

  int *c;                 //declare a pointer to an integer 'c'

  c=(int *)&a;            //Get the memory location of variable 'a' which is
                          //a pointer to 'b'.  Cast that to an int pointer 
                          //and assign it to …
Run Code Online (Sandbox Code Playgroud)

c pointers

26
推荐指数
3
解决办法
13万
查看次数

那么如何在android中的spinner中添加一个int数组

所以我有一个int数组和一个微调器,我需要微调器来显示int数组的值.作为一个新手,我不知道如何将int数组添加到arrayadapter或simpleadapter.我也可以使用列表而不是数组,但它总是包含整数值.

mspin=(Spinner) findViewById(R.id.spinner1);
int[] items=new int[]{1,2,3,4};
ArrayAdapter<int[]> ad=new ArrayAdapter(this,android.R.layout.simple_spinner_item);

//ad.add(items); // this cause some value to be displayed, possible the id of the item.

mspin.setAdapter(ad);
Run Code Online (Sandbox Code Playgroud)

谢谢

java android spinner

2
推荐指数
1
解决办法
5986
查看次数

标签 统计

android ×1

c ×1

java ×1

pointers ×1

spinner ×1