数组和指针 [英] Arrays and Pointers

查看:68
本文介绍了数组和指针的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为作业做更多的事情,这一次是指针。当前的任务是使用一个使用指针的extrnal swap函数对数组进行冒泡排序,并在不使用Arrayname []操作符的情况下引用数组。


无论如何,这里是什么我有:

I''m currently working on some more stuff for an assignment, this time with pointers. The current task is to bubble sort an array using a extrnal swap function that uses pointers, and to reference the array without using the Arrayname[] operator.

Anyways, here''s what I''ve got:

展开 | 选择 | Wrap | < span class =codeLinkonclick =LineNumbers(this);>行号

推荐答案


我目前正在为一项任务做更多的工作,这一次是指针。当前的任务是使用使用指针的extrnal swap函数对数组进行冒泡排序,并在不使用Arrayname []运算符的情况下引用数组。
I''m currently working on some more stuff for an assignment, this time with pointers. The current task is to bubble sort an array using a extrnal swap function that uses pointers, and to reference the array without using the Arrayname[] operator.



Cool。我个人在使用那么多嵌入式循环时遇到了问题,但有些人对此没有任何问题。


您有问题,还是只是发布代码?

Cool. I personally have an issue with using that many embedded loops, but some people have no problem with it.

Did you have a question, or were you just posting code?


是的,抱歉,我不是很清楚。问题是......好吧,它不起作用。我认为问题在于if((numlist + cnt)>(numlist + cnt + 1))和if((numlist + cnt)<(numlist + cnt + 1))语句 - 我认为他们不会'' t正确循环数组。
Yeah, sorry I wasn''t more clear about it. The problem is that...well, it doesn''t work. I think the problem is with the if ((numlist + cnt) > (numlist + cnt + 1)) and if ((numlist + cnt) < (numlist + cnt + 1)) statements-I think they don''t cycle through the array properly.



很酷。我个人在使用那么多嵌入式循环时遇到了问题,但有些人对此没有任何问题。


您有问题,还是只是发布代码?
Cool. I personally have an issue with using that many embedded loops, but some people have no problem with it.

Did you have a question, or were you just posting code?



只有一个嵌入式循环。你认为那太多了?

There is only one embedded loop. You think that is too much?


这篇关于数组和指针的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆