and also where the return statements would be , i was wondering if a return statement should be in the if where isswapped==false... but im not sure.
Type: Posts; User: Kristyy_mariee
and also where the return statements would be , i was wondering if a return statement should be in the if where isswapped==false... but im not sure.
Something is seriously wrong with the loops. And its confusing me.. plus I need to know how to print the array once its sorted. right now im getting the unsorted numbers from the file and just bogus...
No, it does not.
Updated:
#include <iostream>
#include <fstream>
using namespace::std;
int bubblesort( int arrayf[], int size);
Ok this is what ive done so far..
#include <iostream>
using namespace::std;
int bubblesort( int arrayf[], int size);
int bubblesort( int arrayf[], int size)
thanks so much for this... So im trying to apply this code to bubble sort and i kno that bubble sort needs to compare values[i] and values[i-1] im not sure where to place this condition and what to...
Thanks. I understand what youre saying... i just honestly do not know how to make recursion work for this. i have some code which prints 1-10 without a loop but for something as complex as a bubble...
I didnt kno my question asked for somebody to take time out to bull........ on here. but thanks.
Integers will be read from the file and should be bubble sorted.. its a lot of if statements to avoid the for loop and its still not sorting correctly..Is there any way i can shorten this code and...
So for eg, an array of 10 ints wouldn't there be numerous if statements?
Im completly clueless when it comes to recursion it seems so confusing, an example of a recursive function would be great
Yeh its 10 integers, ive been asked to do it so i need to kno if its possible..
Is it possible to bubble sort using no loops? or perhaps a recursive technique?
Id like to determine the output of this code. I've never used bitset before.
#include <iostream>
#include <bitset>
using namespace std;
int main() {
bool isPalindrome(bitset<8> bits);
{
bool palindrome = true;
bitset<Max> b = bits;
for(int i = 0; i < Max/2 - 1; i++) {
if(b[i] ^ b[Max-1-i]) {
palindrome =...
#include <iostream> #include <bitset> using namespace std; int main() { bitset<8> bits = 83; cout << bits << " "; cout << bits.to_ulong() << endl << endl; bits[0] = 0; cout << bits <<...
when i put eihter <> or "" it send the error up to that line saying no such file or directory
hmm i did that already to see if it wouldchange anything. still saying that the class phones is undeclared..
I'm new to writing classes.
This is the class file.
#include <iostream>
#include <string>
using namespace std;
class phones
The entire solution for this problem would be great, im trying to do the same thing with my code..
I agree because this the first course for programming at the university, but its due Thursday and me and the people in my class havent even started on the calculations for this thing
Oh lol, yehh i took it out, didnt change anything though
this is my code now
#include <stdio.h>
#include <string.h>
int main()
{
char name[20];
int patients=1;
Thanks so much, just addin on .txt when i entered the file name works :)
from what I think youre trying to say...I dont think their hard coded if yu mean what i think you mean (fairly new to programming) i basically just have them listed in the file and then their just...