This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int squareThis(int x){ | |
return x*x; | |
} | |
int main(){ | |
cout << squareThis(2); // returns 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int squareThis(int x){ | |
return x*x; | |
} | |
double squareThis(double x){ | |
return x*x; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
template <typename T> // add this line | |
T squareThis(T x){ // replace all occurrences of the type with "T" | |
return x*x; | |
} | |
int main(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
template <typename T> // remember this line makes the class a template | |
class MyVector{ | |
T a[10]; | |
int count; | |
public: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var targetWidth = 768; | |
if ( $(window).width() >= targetWidth) { | |
//Add your javascript for screens wider than or equal to 768 here | |
} | |
else { | |
//Add your javascript for screens smaller than 768 here | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
var targetWidth = 768; | |
if ( $(window).width() >= targetWidth) { | |
//Add your javascript for screens wider than or equal to 768 here | |
} | |
else { | |
//Add your javascript for screens smaller than 768 here | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(window).load(function(){ | |
var targetWidth = 768; | |
if ( $(window).width() >= targetWidth) { | |
//Add your javascript for screens wider than or equal to 768 here | |
} | |
else { | |
//Add your javascript for screens smaller than 768 here | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
w = document.documentElement.clientWidth || document.body.clientWidth || window.innerWidth; | |
var targetWidth = 768; | |
if ( w >= targetWidth) { | |
//Add your javascript for screens wider than or equal to 768 here | |
} | |
else { | |
//Add your javascript for screens smaller than 768 here | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.onload=function(){ | |
w = document.documentElement.clientWidth || document.body.clientWidth || window.innerWidth; | |
var targetWidth = 768; | |
if ( w >= targetWidth) { | |
//Add your javascript for screens wider than or equal to 768 here | |
} | |
else { | |
//Add your javascript for screens smaller than 768 here | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set<int>::iterator i; | |
set<int>::const_iterator ci; |
OlderNewer