•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 456,553 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,460 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C advertiser: Programming Forums
Views: 1920 | Replies: 2
![]() |
| |
•
•
Join Date: Oct 2007
Posts: 5
Reputation:
Rep Power: 0
Solved Threads: 0
Hi. I was wondering if any one could help me with this program. I didn't get any error messages. It was excecuted but the output was incorrect. I got Unordered data: 7 3 66 3 -5 22 -77 2 After pass 1: 7 3 66 3 -5 22 -77 2 and After pass 2: 7 7 7 7 7 7 7 7. The output should be Unordered data: 7 3 66 3 -5 22 -77 2 After pass1: -77 7 66 3 3 22 -5 2 After pass 2: -77 -5 66 7 3 22 3 2.
>void transpo_sort(int a[], int i);
This doesn't call the transpo_sort function, it declares the transpo_sort function. In other words, absolutely nothing is happening to your array.
>printf("After Pass #2:%7d,%5d,%5d,%5d,%5d,%5d,%5d,%5d \n", a[i],a[i],a[i],a[i],a[i],a[i],a[i],a[i]);
i is 0, and a[0] is 7. It's no surprise that printing a[i] eight times gives you eight 7's.
This doesn't call the transpo_sort function, it declares the transpo_sort function. In other words, absolutely nothing is happening to your array.
>printf("After Pass #2:%7d,%5d,%5d,%5d,%5d,%5d,%5d,%5d \n", a[i],a[i],a[i],a[i],a[i],a[i],a[i],a[i]);
i is 0, and a[0] is 7. It's no surprise that printing a[i] eight times gives you eight 7's.
I'm here to prove you wrong.
•
•
Join Date: May 2006
Location: ★ ijug.net ★
Posts: 1,018
Reputation:
Rep Power: 6
Solved Threads: 68
Also it is better if you post the code here than attaching an word doc.
![]() |
•
•
•
•
•
•
•
•
DaniWeb C Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Web Graphic Programs....Design? (Graphics and Multimedia)
- how to use sorting algorithm (Java)
- help me in knowing about sorting techniques (C)
- knowing which programs are needed and which arent (Windows 9x / Me)
- Sorting lists by word length: How do I do it? (Python)
- Compiling Programs (C++)
- article on affiliate programs (Advertising Sales Strategies)
- Vectors, Functions, and Sorting... oh my! (C++)
- re: Sorting Algorithms (C++)
Other Threads in the C Forum
- Previous Thread: Guide to proper code tagging using pictures.
- Next Thread: Counting an inputted letter in an inputted string using getchar()



Hybrid Mode