473,666 Members | 2,073 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

String Alignment problem

Friends,

My Problem is related to writing a text file from a database
using .Net. in a particular string format.
I have a dataset with a table, let suppose in this table there are
three fields.
- Code
- Description
- Amount

At the time of writing a text file I use in a for loop -

String.Format(" {0,10}{1, 40} {2,-10}", DS.Table(0).Row (i)
("Code").ToStri ng(), DS.Table(0).Row (i)("Descriptio n").ToString (),
DS.Table(0).Row (i)("Amount").T oString())
But the problem is related to the alignment. Data comes like in
following format:

01Code 01Desc 2000
02Code 02Desc 3000
03CodeABC 03Desc 4000
04xyz 04Desc 5000
I want Data comes in following proper alignment format.

01Code 01Desc 2000
02Code 02Desc 3000
03CodeABC 03Desc 4000
04xyz 04Desc 5000
So anybody knows the solutions of this problem, please and please
reply imediately, its urgent.

Rahul

Jun 4 '07 #1
10 2274
On Jun 4, 10:08 am, Rahul <verma.car...@g mail.comwrote:
Friends,

My Problem is related to writing a text file from a database
using .Net. in a particular string format.
I have a dataset with a table, let suppose in this table there are
three fields.
- Code
- Description
- Amount

At the time of writing a text file I use in a for loop -

String.Format(" {0,10}{1, 40} {2,-10}", DS.Table(0).Row (i)
("Code").ToStri ng(), DS.Table(0).Row (i)("Descriptio n").ToString (),
DS.Table(0).Row (i)("Amount").T oString())

But the problem is related to the alignment. Data comes like in
following format:

01Code 01Desc 2000
02Code 02Desc 3000
03CodeABC 03Desc 4000
04xyz 04Desc 5000

I want Data comes in following proper alignment format.

01Code 01Desc 2000
02Code 02Desc 3000
03CodeABC 03Desc 4000
04xyz 04Desc 5000

So anybody knows the solutions of this problem, please and please
reply imediately, its urgent.

Rahul
For the formatting option that you have your output will be like:
01Code 01Desc2000
and not
01Code 01Desc 2000

Also, some of the strings may not be getting formatted properly if
length of any string in your dataset exceeds the width that you
specify in the format option.
Can you show me with your real data?

Jun 4 '07 #2
On Jun 4, 10:38 am, GeezerButler <kurtr...@gmail .comwrote:
On Jun 4, 10:08 am, Rahul <verma.car...@g mail.comwrote:


Friends,
My Problem is related to writing a text file from a database
using .Net. in a particular string format.
I have a dataset with a table, let suppose in this table there are
three fields.
- Code
- Description
- Amount
At the time of writing a text file I use in a for loop -
String.Format(" {0,10}{1, 40} {2,-10}", DS.Table(0).Row (i)
("Code").ToStri ng(), DS.Table(0).Row (i)("Descriptio n").ToString (),
DS.Table(0).Row (i)("Amount").T oString())
But the problem is related to the alignment. Data comes like in
following format:
01Code 01Desc 2000
02Code 02Desc 3000
03CodeABC 03Desc 4000
04xyz 04Desc 5000
I want Data comes in following proper alignment format.
01Code 01Desc 2000
02Code 02Desc 3000
03CodeABC 03Desc 4000
04xyz 04Desc 5000
So anybody knows the solutions of this problem, please and please
reply imediately, its urgent.
Rahul

For the formatting option that you have your output will be like:
01Code 01Desc2000
and not
01Code 01Desc 2000

Also, some of the strings may not be getting formatted properly if
length of any string in your dataset exceeds the width that you
specify in the format option.
Can you show me with your real data?- Hide quoted text -

- Show quoted text -
thanks for reply
I have put '-' on the place of space for better understanding.
This comes for Northwind database, product table
the real data is :

alice mutton----------------------------alice mutton

aniseed syrup---------------------------aniseed syrup

boston crab meat------------------------boston crab meat

camembert pierrot-----------------------camembert pierrot

carnarvon tigers------------------------carnarvon tigers

chai------------------------------------chai

chang-----------------------------------chang

chartreuse verte------------------------chartreuse verte

chef anton's cajun seasoning------------chef anton's cajun seasoning

chef anton's gumbo mix------------------chef anton's gumbo mix

chocolade-------------------------------chocolade

côte de blaye---------------------------côte de blaye

escargots de bourgogne------------------escargots de bourgogne

filo mix--------------------------------filo mix

flotemysost-----------------------------flotemysost

geitost---------------------------------geitost

genen shouyu----------------------------genen shouyu

gnocchi di nonna alice------------------gnocchi di nonna alice

gorgonzola telino-----------------------gorgonzola telino

grandma's boysenberry spread------------grandma's boysenberry spread

gravad lax------------------------------gravad lax

guaraná fantástica----------------------guaraná fantástica

gudbrandsdalsos t------------------------gudbrandsdalsos t

gula malacca----------------------------gula malacca

gumbär gummibärchen---------------------gumbär gummibärchen

gustaf's knäckebröd---------------------gustaf's knäckebröd

ikura-----------------------------------ikura

inlagd sill-----------------------------inlagd sill

ipoh coffee-----------------------------ipoh coffee

jack's new england clam chowder---------jack's new england clam
chowder

konbu-----------------------------------konbu

lakkalikööri----------------------------lakkalikööri

laughing lumberjack lager---------------laughing lumberjack lager

longlife tofu---------------------------longlife tofu

louisiana fiery hot pepper sauce--------louisiana fiery hot pepper
sauce

louisiana hot spiced okra---------------louisiana hot spiced okra

manjimup dried apples-------------------manjimup dried apples

mascarpone fabioli----------------------mascarpone fabioli

maxilaku--------------------------------maxilaku

mishi kobe niku-------------------------mishi kobe niku

mozzarella di giovanni------------------mozzarella di giovanni

nord-ost matjeshering-------------------nord-ost matjeshering

northwoods cranberry sauce--------------northwoods cranberry sauce

nunuca nuß-nougat-creme-----------------nunuca nuß-nougat-creme

original frankfurter grüne soße---------original frankfurter grüne
soße

outback lager---------------------------outback lager

pâté chinois----------------------------pâté chinois

pavlova---------------------------------pavlova

perth pasties---------------------------perth pasties

queso cabrales--------------------------queso cabrales

queso manchego la pastora---------------queso manchego la pastora

raclette courdavault--------------------raclette courdavault

ravioli angelo--------------------------ravioli angelo

rhönbräu klosterbier--------------------rhönbräu klosterbier

röd kaviar------------------------------röd kaviar

rogede sild-----------------------------rogede sild

rössle sauerkraut-----------------------rössle sauerkraut

sasquatch ale---------------------------sasquatch ale

schoggi schokolade----------------------schoggi schokolade

scottish longbreads---------------------scottish longbreads

singaporean hokkien fried mee-----------singaporean hokkien fried mee

sir rodney's marmalade------------------sir rodney's marmalade

sir rodney's scones---------------------sir rodney's scones

sirop d'érable--------------------------sirop d'érable

spegesild-------------------------------spegesild

steeleye stout--------------------------steeleye stout

tarte au sucre--------------------------tarte au sucre

teatime chocolate biscuits--------------teatime chocolate biscuits

thüringer rostbratwurst-----------------thüringer rostbratwurst

tofu------------------------------------tofu

tourtière-------------------------------tourtière

tunnbröd--------------------------------tunnbröd

uncle bob's organic dried pears---------uncle bob's organic dried
pears

valkoinen suklaa------------------------valkoinen suklaa

vegie-spread----------------------------vegie-spread

wimmers gute semmelknödel---------------wimmers gute semmelknödel

zaanse koeken---------------------------zaanse koeken
Rahul

Jun 4 '07 #3
You should organize the output into a table with 3 columns. The easiest way
is to use GridView control databound to your dataset.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Rahul" <ve**********@g mail.comwrote in message
news:11******** **************@ j4g2000prf.goog legroups.com...
Friends,

My Problem is related to writing a text file from a database
using .Net. in a particular string format.
I have a dataset with a table, let suppose in this table there are
three fields.
- Code
- Description
- Amount

At the time of writing a text file I use in a for loop -

String.Format(" {0,10}{1, 40} {2,-10}", DS.Table(0).Row (i)
("Code").ToStri ng(), DS.Table(0).Row (i)("Descriptio n").ToString (),
DS.Table(0).Row (i)("Amount").T oString())
But the problem is related to the alignment. Data comes like in
following format:

01Code 01Desc 2000
02Code 02Desc 3000
03CodeABC 03Desc 4000
04xyz 04Desc 5000
I want Data comes in following proper alignment format.

01Code 01Desc 2000
02Code 02Desc 3000
03CodeABC 03Desc 4000
04xyz 04Desc 5000
So anybody knows the solutions of this problem, please and please
reply imediately, its urgent.

Rahul

Jun 4 '07 #4
On Jun 4, 8:08 am, Rahul <verma.car...@g mail.comwrote:
On Jun 4, 10:38 am, GeezerButler <kurtr...@gmail .comwrote:
01Code 01Desc 2000
Also, some of the strings may not be getting formatted properly if
length of any string in your dataset exceeds the width that you
specify in the format option.
Can you show me with your real data?- Hide quoted text -

thanks for reply
I have put '-' on the place of space for better understanding.
This comes for Northwind database, product table
I think it's because of the size of the strings.

When you have

String.Format(" {0,10}....

it does mean the length of the Code-field cannot be more than 10
characters, in other case it would shift the whole line.

Try to change

String.Format(" {0,10}{1, 40} {2,-10}",
Left(DS.Table(0 ).Row(i)("Code" ).ToString(), 10),
Left(DS.Table(0 ).Row(i)("Descr iption").ToStri ng(), 40),
DS.Table(0).Row (i)("Amount").T oString())

I think it should help

Jun 4 '07 #5
On Jun 4, 9:02 am, "Eliyahu Goldin"
<REMOVEALLCAPIT ALSeEgGoldD...@ mMvVpPsS.orgwro te:
You should organize the output into a table with 3 columns. The easiest way
is to use GridView control databound to your dataset.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]http://msmvps.com/blogs/egoldinhttp://usableasp.net
He is writing a text file.

Jun 4 '07 #6
On Jun 4, 11:08 am, Rahul <ve**********@g mail.comwrote:
On Jun 4, 10:38 am, GeezerButler <kurtr...@gmail .comwrote:


On Jun 4, 10:08 am, Rahul <verma.car...@g mail.comwrote:
Friends,
My Problem is related to writing a text file from a database
using .Net. in a particular string format.
I have a dataset with a table, let suppose in this table there are
three fields.
- Code
- Description
- Amount
At the time of writing a text file I use in a for loop -
String.Format(" {0,10}{1, 40} {2,-10}", DS.Table(0).Row (i)
("Code").ToStri ng(), DS.Table(0).Row (i)("Descriptio n").ToString (),
DS.Table(0).Row (i)("Amount").T oString())
But the problem is related to the alignment. Data comes like in
following format:
01Code 01Desc 2000
02Code 02Desc 3000
03CodeABC 03Desc 4000
04xyz 04Desc 5000
I want Data comes in following proper alignment format.
01Code 01Desc 2000
02Code 02Desc 3000
03CodeABC 03Desc 4000
04xyz 04Desc 5000
So anybody knows the solutions of this problem, please and please
reply imediately, its urgent.
Rahul
For the formatting option that you have your output will be like:
01Code 01Desc2000
and not
01Code 01Desc 2000
Also, some of the strings may not be getting formatted properly if
length of any string in your dataset exceeds the width that you
specify in the format option.
Can you show me with your real data?- Hide quoted text -
- Show quoted text -

thanks for reply
I have put '-' on the place of space for better understanding.
This comes for Northwind database, product table
the real data is :

alice mutton----------------------------alice mutton

aniseed syrup---------------------------aniseed syrup

boston crab meat------------------------boston crab meat

camembert pierrot-----------------------camembert pierrot

carnarvon tigers------------------------carnarvon tigers

chai------------------------------------chai

chang-----------------------------------chang

chartreuse verte------------------------chartreuse verte

chef anton's cajun seasoning------------chef anton's cajun seasoning

chef anton's gumbo mix------------------chef anton's gumbo mix

chocolade-------------------------------chocolade

côte de blaye---------------------------côte de blaye

escargots de bourgogne------------------escargots de bourgogne

filo mix--------------------------------filo mix

flotemysost-----------------------------flotemysost

geitost---------------------------------geitost

genen shouyu----------------------------genen shouyu

gnocchi di nonna alice------------------gnocchi di nonna alice

gorgonzola telino-----------------------gorgonzola telino

grandma's boysenberry spread------------grandma's boysenberry spread

gravad lax------------------------------gravad lax

guaraná fantástica----------------------guaraná fantástica

gudbrandsdalsos t------------------------gudbrandsdalsos t

gula malacca----------------------------gula malacca

gumbär gummibärchen---------------------gumbär gummibärchen

gustaf's knäckebröd---------------------gustaf's knäckebröd

ikura-----------------------------------ikura

inlagd sill-----------------------------inlagd sill

ipoh coffee-----------------------------ipoh coffee

jack's new england clam chowder---------jack's new england clam
chowder

konbu-----------------------------------konbu

lakkalikööri----------------------------lakkalikööri

laughing lumberjack lager---------------laughing lumberjack lager

longlife tofu---------------------------longlife tofu

louisiana fiery hot pepper sauce--------louisiana fiery hot pepper
sauce

louisiana hot spiced okra---------------louisiana hot spiced okra

manjimup dried apples-------------------manjimup dried apples

mascarpone fabioli----------------------mascarpone fabioli

maxilaku--------------------------------maxilaku

mishi kobe niku-------------------------mishi kobe niku

mozzarella di giovanni------------------mozzarella di giovanni

nord-ost matjeshering-------------------nord-ost matjeshering

northwoods cranberry sauce--------------northwoods cranberry sauce

nunuca nuß-nougat-creme-----------------nunuca nuß-nougat-creme

original frankfurter grüne soße---------original frankfurter grüne
soße

outback lager---------------------------outback lager

pâté chinois----------------------------pâté chinois

pavlova---------------------------------pavlova

perth pasties---------------------------perth pasties

queso cabrales--------------------------queso cabrales

queso manchego la pastora---------------queso manchego la pastora

raclette courdavault--------------------raclette courdavault

ravioli angelo--------------------------ravioli angelo

rhönbräu klosterbier--------------------rhönbräu klosterbier

röd kaviar------------------------------röd kaviar

rogede sild-----------------------------rogede sild

rössle sauerkraut-----------------------rössle sauerkraut

sasquatch ale---------------------------sasquatch ale

schoggi schokolade----------------------schoggi schokolade

scottish longbreads---------------------scottish longbreads

singaporean hokkien fried mee-----------singaporean hokkien fried mee

sir rodney's marmalade------------------sir rodney's marmalade

sir rodney's scones---------------------sir rodney's scones

sirop d'érable--------------------------sirop d'érable

spegesild-------------------------------spegesild

steeleye stout--------------------------steeleye stout

tarte au sucre--------------------------tarte au sucre

teatime chocolate biscuits--------------teatime chocolate biscuits

thüringer rostbratwurst-----------------thüringer rostbratwurst

tofu------------------------------------tofu

tourtière-------------------------------tourtière

tunnbröd--------------------------------tunnbröd

uncle bob's organic dried pears---------uncle bob's organic dried
pears

valkoinen suklaa------------------------valkoinen suklaa

vegie-spread----------------------------vegie-spread

wimmers gute semmelknödel---------------wimmers gute semmelknödel

zaanse koeken---------------------------zaanse koeken

Rahul- Hide quoted text -

- Show quoted text -
Are you writing this to a text file or a web page?
If you copy paste all the data you posted in the post above to
textpad, you'll see that it is correctly formatted.
But the same data does not look ok on a web page like this one,
because the fonts are not monospaced ( i think).
If you are writing to a web page then follow Eliyahu's advice and bind
it to some table.

Jun 4 '07 #7
On Jun 4, 12:13 pm, GeezerButler <kurtr...@gmail .comwrote:
On Jun 4, 11:08 am, Rahul <verma.car...@g mail.comwrote:


On Jun 4, 10:38 am, GeezerButler <kurtr...@gmail .comwrote:
On Jun 4, 10:08 am, Rahul <verma.car...@g mail.comwrote:
Friends,
My Problem is related to writing a text file from a database
using .Net. in a particular string format.
I have a dataset with a table, let suppose in this table there are
three fields.
- Code
- Description
- Amount
At the time of writing a text file I use in a for loop -
String.Format(" {0,10}{1, 40} {2,-10}", DS.Table(0).Row (i)
("Code").ToStri ng(), DS.Table(0).Row (i)("Descriptio n").ToString (),
DS.Table(0).Row (i)("Amount").T oString())
But the problem is related to the alignment. Data comes like in
following format:
01Code 01Desc 2000
02Code 02Desc 3000
03CodeABC 03Desc 4000
04xyz 04Desc 5000
I want Data comes in following proper alignment format.
01Code 01Desc 2000
02Code 02Desc 3000
03CodeABC 03Desc 4000
04xyz 04Desc 5000
So anybody knows the solutions of this problem, please and please
reply imediately, its urgent.
Rahul
For the formatting option that you have your output will be like:
01Code 01Desc2000
and not
01Code 01Desc 2000
Also, some of the strings may not be getting formatted properly if
length of any string in your dataset exceeds the width that you
specify in the format option.
Can you show me with your real data?- Hide quoted text -
- Show quoted text -
thanks for reply
I have put '-' on the place of space for better understanding.
This comes for Northwind database, product table
the real data is :
alice mutton----------------------------alice mutton
aniseed syrup---------------------------aniseed syrup
boston crab meat------------------------boston crab meat
camembert pierrot-----------------------camembert pierrot
carnarvon tigers------------------------carnarvon tigers
chai------------------------------------chai
chang-----------------------------------chang
chartreuse verte------------------------chartreuse verte
chef anton's cajun seasoning------------chef anton's cajun seasoning
chef anton's gumbo mix------------------chef anton's gumbo mix
chocolade-------------------------------chocolade
côte de blaye---------------------------côte de blaye
escargots de bourgogne------------------escargots de bourgogne
filo mix--------------------------------filo mix
flotemysost-----------------------------flotemysost
geitost---------------------------------geitost
genen shouyu----------------------------genen shouyu
gnocchi di nonna alice------------------gnocchi di nonna alice
gorgonzola telino-----------------------gorgonzola telino
grandma's boysenberry spread------------grandma's boysenberry spread
gravad lax------------------------------gravad lax
guaraná fantástica----------------------guaraná fantástica
gudbrandsdalsos t------------------------gudbrandsdalsos t
gula malacca----------------------------gula malacca
gumbär gummibärchen---------------------gumbär gummibärchen
gustaf's knäckebröd---------------------gustaf's knäckebröd
ikura-----------------------------------ikura
inlagd sill-----------------------------inlagd sill
ipoh coffee-----------------------------ipoh coffee
jack's new england clam chowder---------jack's new england clam
chowder
konbu-----------------------------------konbu
lakkalikööri----------------------------lakkalikööri
laughing lumberjack lager---------------laughing lumberjack lager
longlife tofu---------------------------longlife tofu
louisiana fiery hot pepper sauce--------louisiana fiery hot pepper
sauce
louisiana hot spiced okra---------------louisiana hot spiced okra
manjimup dried apples-------------------manjimup dried apples
mascarpone fabioli----------------------mascarpone fabioli
maxilaku--------------------------------maxilaku
mishi kobe niku-------------------------mishi kobe niku
mozzarella di giovanni------------------mozzarella di giovanni
nord-ost matjeshering-------------------nord-ost matjeshering
northwoods cranberry sauce--------------northwoods cranberry sauce
nunuca nuß-nougat-creme-----------------nunuca nuß-nougat-creme
original frankfurter grüne soße---------original frankfurter grüne
soße
outback lager---------------------------outback lager
pâté chinois----------------------------pâté chinois
pavlova---------------------------------pavlova
perth pasties---------------------------perth pasties
queso cabrales--------------------------queso cabrales
queso manchego la pastora---------------queso manchego la pastora
raclette courdavault--------------------raclette courdavault
ravioli angelo--------------------------ravioli angelo
rhönbräu klosterbier--------------------rhönbräu klosterbier
röd kaviar------------------------------röd kaviar
rogede sild-----------------------------rogede sild
rössle sauerkraut-----------------------rössle sauerkraut
sasquatch ale---------------------------sasquatch ale
schoggi schokolade----------------------schoggi schokolade
scottish longbreads---------------------scottish longbreads
singaporean hokkien fried mee-----------singaporean hokkien fried mee
sir rodney's marmalade------------------sir rodney's marmalade
sir rodney's scones---------------------sir rodney's scones
sirop d'érable--------------------------sirop d'érable
spegesild-------------------------------spegesild
steeleye stout--------------------------steeleye stout
tarte au sucre--------------------------tarte au sucre
teatime chocolate biscuits--------------teatime chocolate biscuits
thüringer rostbratwurst-----------------thüringer rostbratwurst
tofu------------------------------------tofu
tourtière-------------------------------tourtière
tunnbröd--------------------------------tunnbröd
uncle bob's organic dried pears---------uncle bob's organic dried
pears
valkoinen suklaa------------------------valkoinen suklaa
vegie-spread----------------------------vegie-spread
wimmers gute semmelknödel---------------wimmers gute semmelknödel
zaanse koeken---------------------------zaanse koeken
Rahul- Hide quoted text -
- Show quoted text -

Are you writing this to a text file or a web page?
If you copy paste all the data you posted in the post above to
textpad, you'll see that it is correctly formatted.
But the same data does not look ok on a web page like this one,
because the fonts are not monospaced ( i think).
If you are writing to a web page then follow Eliyahu's advice and bind
it to some table.- Hide quoted text -

- Show quoted text -
Hi ,

I am writing in a simple text file.
here i use '-' character on the place of a single space.

Rahul

Jun 4 '07 #8
On Jun 4, 9:27 am, Rahul <verma.car...@g mail.comwrote:
Hi ,

I am writing in a simple text file.
here i use '-' character on the place of a single space.

Rahul- Hide quoted text -

- Show quoted text -
If you don't really need a text to be right aligned, you can try to
use a tab

e.g.

String.Format(" {0}" & vbTab & "{1}" & vbTab & "{2}", ...

Jun 4 '07 #9
On Jun 4, 12:10 pm, Alexey Smirnov <alexey.smir... @gmail.comwrote :
On Jun 4, 8:08 am, Rahul <verma.car...@g mail.comwrote:O n Jun 4, 10:38 am, GeezerButler <kurtr...@gmail .comwrote:
01Code 01Desc 2000


Also, some of the strings may not be getting formatted properly if
length of any string in your dataset exceeds the width that you
specify in the format option.
Can you show me with your real data?- Hide quoted text -
thanks for reply
I have put '-' on the place of space for better understanding.
This comes for Northwind database, product table

I think it's because of the size of the strings.

When you have

String.Format(" {0,10}....

it does mean the length of the Code-field cannot be more than 10
characters, in other case it would shift the whole line.

Try to change

String.Format(" {0,10}{1, 40} {2,-10}",
Left(DS.Table(0 ).Row(i)("Code" ).ToString(), 10),
Left(DS.Table(0 ).Row(i)("Descr iption").ToStri ng(), 40),
DS.Table(0).Row (i)("Amount").T oString())

I think it should help
Hi,

I have try it, but not working, and output is same

String.Format(" {0,10}{1, 40} {2,-10}",
Left(DS.Table(0 ).Row(i)("Code" ).ToString(), 10),
Left(DS.Table(0 ).Row(i)("Descr iption").ToStri ng(), 40),
DS.Table(0).Row (i)("Amount").T oString())

Jun 4 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
8807
by: Simon Schaap | last post by:
Hello, I have encountered a strange problem and I hope you can help me to understand it. What I want to do is to pass an array of chars to a function that will split it up (on every location where a * occurs in the string). This split function should allocate a 2D array of chars and put the split results in different rows. The listing below shows how I started to work on this. To keep the program simple and help focus the program the...
67
10708
by: S.Tobias | last post by:
I would like to check if I understand the following excerpt correctly: 6.2.5#26 (Types): All pointers to structure types shall have the same representation and alignment requirements as each other. All pointers to union types shall have the same representation and alignment requirements as each other. Does it mean that *all* structure (or union) types have the same alignment? Eg. type
13
684
by: sachin_mzn | last post by:
Hi, What is the concept of memory alignment? Is memory alignment differs, If a data type is local to a function or if it is a member of structure or union? How 32 to 64 bit processor afftects the memory alignment?
5
3904
by: Hendrik Schober | last post by:
Hi, we just run into the problem, that "default" alignment in the project properies dialog seem to be different. We have a project that's a DLL, which is linked with a couple of LIBs. All are with the same solution. All had "Default" set in the "Struct Member Alignment" entry. After some assembler debugging we found out that a struct member that is a member function pointer in
8
2337
by: Cardman | last post by:
I am hopeful that someone can quickly solve my image alignment issue when things are just not going right and where my attempts to solve this alignment issue have all failed. First of all take a look here... http://www.cardman.com/switches.html In MIE this page looks perfect. Unfortunately both Netscape and Opera show these item photos in the wrong place. For some *unknown* reason all the photos drop down to align with the green...
12
818
by: Yevgen Muntyan | last post by:
Hey, Consider the following code: #include <stdlib.h> #define MAGIC_NUMBER 64 void *my_malloc (size_t n) { char *result = malloc (n + MAGIC_NUMBER);
10
2204
by: haomiao | last post by:
I want to implement a common list that can cantain any type of data, so I declare the list as (briefly) --------------------------------------- struct list { int data_size; int node_num; char nodes; //will be list_node1,list_node2... };
5
4393
by: Rahul | last post by:
Friends, My Problem is related to writing a text file from a database using .Net. in a particular string format. I have a dataset with a table, let suppose in this table there are three fields. - Code - Description - Amount
8
2818
by: Stephen Horne | last post by:
I understand that the next C++ standard will have features to handle the alignment of data types. This is good, but a bit late for me! I've been using some template trickery to handle alignment issues for some time. What I usually want is a type that takes the same amount of space and has the same alignment as some other type, but which doesn't have constructors, destructors etc. The idea is that initialisation and cleanup can be done...
0
8871
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8552
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8640
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7387
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6198
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1776
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.