Site Tools


c_find

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

c_find [2013/02/26 20:04] (current)
konovalov created
Line 1: Line 1:
 +  int arr[8] = {42, 31, 53, 123, 346, 567, 678, 1}; 
 +   
 +  int main(int argc, char** argv){ 
 +      int *ptr; 
 +      ptr = find(arr, arr+8, 346); 
 +      cout << "​ptr:"​ << ptr << " arr:" << arr << endl; 
 +      cout << "Find in " << (ptr-arr) << endl; 
 +  } 
 +  //​вывод 
 +  ptr:​0x804a070 arr:​0x804a060 // 070 - 060 = F // F \ 4 = 4 (int = 4 byte) 
 +  Find in 4
c_find.txt · Last modified: 2013/02/26 20:04 by konovalov

Page Tools