Автор | Сообщение |
|
Отправлено: 30.07.15 17:32. Заголовок: array with alternate even and odd
hey, as discussed program for alternate even and odd numbers #include<stdio.h> int main() { int a[]={9,8,8,7,6,5,14}; int n= sizeof(a) / sizeof(a[0]); int i,j; int t1; for(i=0;i<n;i++) { for(j=i+1;j<n;j++) { if(a[ i ]>a[ j ]) { t1=a[ i ]; a[ i ]=a[ j ]; a[ j ]=t1; } } }
|
|
|
Ответов - 26
, стр:
1
2
All
[только новые]
|
|
|
Отправлено: 03.08.15 23:50. Заголовок: Pointers are also va..
Pointers are also variables. When you deal with an array then 1) the array name in expressions is converted to pointer and 2) to traverse an array you have to use either pointers or indices.
|
|
|
|
Отправлено: 04.08.15 00:02. Заголовок: pointers
so, how to convert a given pointer to indices? is it possible? or vice vers?
|
|
|
|
Отправлено: 04.08.15 00:06. Заголовок: I already showed you..
I already showed you early the function that uses indices instead of the pointers.
|
|
|
|
Отправлено: 04.08.15 00:19. Заголовок: thanks
yea, u did, just small confusions, any pdf u recommend for reading?
|
|
|
|
Отправлено: 04.08.15 00:39. Заголовок: You should read a bo..
You should read a book on C++ for beginners. I think you can find a list of books at SO. As for me then I do not read books for beginners so I can not say what books for beginners are published now.
|
|
|
|
Отправлено: 04.08.15 00:53. Заголовок: thanks
yea, thanx a lot for help. cleared so many doubts. nice meeting u, sir
|
|
|
Ответов - 26
, стр:
1
2
All
[только новые]
|
|