Contains the source code from the course work throughout my undergraduate Computer Engineering degree at Brigham Young University. There is a mixture of Go, Python, C, C++, Java, VHDL, Verilog, Matlab, Bash, Assembly, etc..
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

array.cpp 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #include <iostream>
  2. #include <array>
  3. using namespace std;
  4. int main() {
  5. array<string,16> test;
  6. for(unsigned int i = 0; i < test.size(); i++) {
  7. string a;
  8. cout << i << " enter name" << endl;
  9. cin >> a;
  10. test[i] = a;
  11. }
  12. int a = 0;
  13. cout << "i++" << endl;
  14. for(unsigned int i = 0; i < test.size(); i++) {
  15. cout << test[i] << "-" << i << " /";
  16. }
  17. cout << "" << endl;
  18. cout << "i--" << endl;
  19. for(unsigned int i = 15; i > 0; i--) {
  20. cout << test[i] << "-" << i << " /";
  21. }
  22. cout << "" << endl;
  23. cout << test.size() << " size of thing" << endl;
  24. cout << "" << endl;
  25. for(unsigned int i = 0; i < test.size(); i++) {
  26. if(test[i] == "derek") {
  27. a = i;
  28. }
  29. }
  30. for(a; a < test.size(); a++) {
  31. int b = a;
  32. test[a] = test[b++];
  33. }
  34. cout << "something happening here" << a << " is where derek is" << endl;
  35. for(unsigned int i = 0; i < test.size(); i++) {
  36. cout << test[i] << "-" << i << " /";
  37. }
  38. cout << "" << endl;
  39. }