C / C++ Code Portfolio


return 0; } // This function returns a substring from a given string char



Download 112,15 Kb.
bet2/30
Sana01.03.2022
Hajmi112,15 Kb.
#475852
1   2   3   4   5   6   7   8   9   ...   30
Bog'liq
dddd

return 0;
}
// This function returns a substring from a given string

char *GetSubstring(const char source[], int start, int count, char result[])
{
char *resultAddress = result;

do
{
if ((*source == '\0') || start == 0) // if string has ended or substring has started
break;
} while (*source++ && start--); // otherwise advance one char in string, decrement start

while ((*source != '\0') && count > 0) // while string hasnt ended nor substring ended
{
*result++ = *source++; // store character of string into substring
count--; // advance substring counter
}

*result = '\0'; // store null character as final character in substring



return resultAddress; // this return statement should never be executed
}
// This program converts a string to all upper case

#include


#include

size_t StrToUpper(char *newString, const char *origString)


{
const char *newStringStart = newString;
while (*newString++ = toupper(*origString++));
return((newString - newStringStart) -1);
}
// This function uses strtok() to delimit strings from a file and display each delimited piece on a new line

#include


#include
#include
#include

// No line in the file will ever exceed this size


#define MAX_LINE_SIZE 255
// These are the delimiters used to parse the string
#define DELIMITERS "AEIOUaeiou\t\n"

void ParseStringFields(FILE *fp)
{
char line[MAX_LINE_SIZE];
// while fgets doesn't return a NULL, get the next line from the file
while (fgets(line, MAX_LINE_SIZE, fp))
{
// for each delimited piece of the line, print the piece of the line to the console
// start on the first non-whitespace character in the string

Download 112,15 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9   ...   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