C / C++ Code Portfolio



Download 112,15 Kb.
bet9/30
Sana01.03.2022
Hajmi112,15 Kb.
#475852
1   ...   5   6   7   8   9   10   11   12   ...   30
Bog'liq
dddd

unsigned int intTest = 1;
int numBitsCounter;
// perform left bit shift on the unsigned int. when the unsigned int is equal to 0, we are done
// increment the bit counter for each left bit shift performed on the unsigned int
for (numBitsCounter = 1; intTest <<= 1; ++numBitsCounter)
;
// return the bit counter value
return numBitsCounter;
}
// This function performs a "count"-length bitwise circular shift on unsigned object "object"

int CountIntBitsF();

unsigned Rotate(unsigned object, int count)
{
// if count is negative, perform a left circular shift
if (count <= 0)
{
// left shift object count bits
unsigned firstShift = object << -count % CountIntBitsF();
// right shift object count bits less than the number of bits in an unsigned
unsigned secondShift = object >> (CountIntBitsF() - (-count % CountIntBitsF()));
// bitwise-ORing the left and right shifts gives the final left circular shift
return(firstShift | secondShift);
}
// if count is positive, perform a right circular shift
else
{
// right shift object count bits
unsigned firstShift = object >> count % CountIntBitsF();
// left shift object count bits less than the number of bits in an unsigned
unsigned secondShift = object << (CountIntBitsF() - (count % CountIntBitsF()));
// bitwise-ORing the left and right shifts gives the final right circular shift
return(firstShift | secondShift);
}
}
File Handling
// This function opens count files specified by fileNames

#include


#include
#include

using namespace std;

ifstream *OpenFiles(char * const fileNames[], size_t count)


{
// if the number of files specified by count is zero, output an error message and exit

Download 112,15 Kb.

Do'stlaringiz bilan baham:
1   ...   5   6   7   8   9   10   11   12   ...   30




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish