From c54b4ce2ebf79a086ff3e3d57746244abb1a726a Mon Sep 17 00:00:00 2001 From: mpabi Date: Sun, 26 May 2024 15:19:37 +0000 Subject: [PATCH] sort --- cpp/_rvmain.cpp | 7 ++++++- cpp/myfunc.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cpp/_rvmain.cpp b/cpp/_rvmain.cpp index f55b304..654ea3e 100644 --- a/cpp/_rvmain.cpp +++ b/cpp/_rvmain.cpp @@ -136,11 +136,16 @@ int alg(char *ptr) { // gdb: p/x (model[]*)p[0].len // gdb: p/s (char *)(model[]*)p[2].ptr +// gdb: p *p@5 // :) powered by rv32i int main() { char *str = " Success is often defined as the ability to reach your goals in life, whatever those goals may be. In some ways, a better word for success might be attainment, accomplishment, or progress. It is not necessarily a destination but a journey that helps develop the skills and resources you need to thrive."; alg(str); - asm ("nop"); + asm ("nop"); + + bubbleSort(p,10); + + asm ("nop"); return 1; } diff --git a/cpp/myfunc.h b/cpp/myfunc.h index a18943c..c4206e8 100644 --- a/cpp/myfunc.h +++ b/cpp/myfunc.h @@ -8,4 +8,6 @@ struct model { uint32_t len ; }; +void bubbleSort(model arr[], int n); + #endif