|
Consoles Applications are character mode ones (like the command prompt), see
http://msdn2.microsoft.com/en-us/library/ms682055.aspx[^]
BTW often the standard C (or C++) Run-Time I/O library is used (instead of Console Functions) to provide I/O to such applications.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
File->New->Project->Win32->Win32 Console Application
|
|
|
|
|
dear all
#include <iostream>
using std::cout;
using std::endl;
void printArray(double [][4]);
int main()
{
double a[3][4] = {{0.3,0.4,0.5,0.6},{0.1,0.7,0.8,0.9},{0.11,0.12,0.13,0.14}};
printArray(a);
return 0;
}
void printArray(double a[][4])
{
for (int i = 1; i<=3; i++)
{
for (int j = 1; j j<=4; j++)
cout << a[i][j] << " ";
cout << endl;
}
}
why the result is changed in the end of one row?
thanks
Li Zhiyuan
4/01/2008
|
|
|
|
|
Hey man, C++ arrays (like C ones) are 0-based, for instance
int a[3];
a[0] = 5;
a[1] = 2;
a[2] = 4;
a[3] = 12
hence check your iteration limits.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
#include <iostream>
using std::cout;
using std::endl;
void printArray(double [][4]);
int main()
{
double a[3][4] = {{0.3,0.4,0.5,0.6},{0.1,0.7,0.8,0.9},{0.11,0.12,0.13,0.14}};
printArray(a);
return 0;
}
void printArray(double a[][4])
{
//Have the starting index as 0
for (int i = 0; i<3; i++)
{
for (int j = 0; j<4; j++)
cout << a[i][j] << " ";
cout << endl;
}
}
a[0][0] = 0.3
a[0][1] = 0.4
a[0][2] = 0.5
a[0][3] = 0.6
a[1][0] = 0.1
a[1][1] = 0.7
a[1][2] = 0.8
a[1][3] = 0.9
a[2][0] = 0.11
a[2][1] = 0.12
a[2][2] = 0.13
a[2][3] = 0.14
VIBIN
"Fool's run away,where angle's fear to tread"
|
|
|
|
|
Hi all,
can I create deep folder hierarchy which is exceeding 260 characters on windows 2003 server?
Is there any way to do this?
|
|
|
|
|
vikrams wrote: can I create deep folder hierarchy which is exceeding 260 characters...
260 characters for the whole path, or just one of the folders in the path? Have you looked at SHCreateDirectoryEx() ?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
In the whole path. like c:\qbc\def\jhi\....
I looked into SHCreateDirectory. I found a limit of 248 chars.
But When I look CreateDirectory [naming a file link ] I got confused.
|
|
|
|
|
vikrams wrote:
I looked into SHCreateDirectory. I found a limit of 248 chars.
SHCreateDirectoryEx() has a limit of MAX_PATH characters, but it will create folders recursively.
vikrams wrote: But When I look CreateDirectory [naming a file link ] I got confused.
CreateDirectoryEx() has a limit of 32,000 characters when Unicode is used.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks for the great information. I have created a directory hierarchy .
Now I have problem is accessing it programmatically. I tried using CreateFile but it fails.
|
|
|
|
|
You may want to use make sure you're using the Unicode version of CreateFile and make sure the path specification starts with \\?\ .
I recommend against using such long path names because of very limited tool support when the path name gets beyond MAX_PATH length. Shorten the directory names where possible and flatten your directory structure as much as possible to stay under the MAX_PATH limit.
Read this[^], and this[^].
|
|
|
|
|
Hi All,
thanks to everybody for great help.
|
|
|
|
|
Hello All,
I am working on a application with VS 2005, in which so many calculation is happaning and also graphics is drawing.
i am having some statement in which values are coming as follows
double aa1 = 69444400000.0;
double aa3 = 694.0;
double aa4 = aa1 + aa3;
if i performed these statement before graphics is drawing than they calculating correctlly
the values of aa4 is 69444400694.0
but after drawing the value is : 69444403200.0
while value shold be 69444400694.0
plese give some idea...
thanks
Banks
|
|
|
|
|
Could you make a clone of the variable for backup, and then add some breakpoints to trace the value of aa4 ?!
double dTemp = aa4;
Maxwell Chen
|
|
|
|
|
Try to post the relevant code.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
thanks for reply,
even i am using hardcoded vaues as i write in my previous post.
than also VS is not able to clculate or right value.
when i calculate by these variables in immediate window than it shows right value.
thanks
|
|
|
|
|
bankey1010 wrote: even i am using hardcoded vaues as i write in my previous post.
than also VS is not able to clculate or right value.
I know you hard-coded such values, but what about the graphics you're doing?
What kind of memory accesses are you doing?
How can we help if you don't post the code?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Your drawing logic may be altering the value. Try declaring aa4 as a const double . But, some of us may be providing you an appropriate solution if you post some relevant code.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->ßRÅhmmÃ<-·´¯`·.
|
|
|
|
|
bankey1010 wrote: but after drawing the value is : 69444403200.0
How are you verifying this?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
error LNK2001: unresolved external symbol "class DIR_320 * dir_320" (?dir_320@@3PAVDIR_320@@A) D320_DIS.obj.
error LNK2001: unresolved external symbol "char * ASTERIX" (?ASTERIX@@3PADA) D320_DIS.obj
I am getting the above errors while building my application. Class DIR_320 is in dircomm.h and it is included in D320_DIS.cpp where it is referenced.
Can any one provide solutions on how to fix these?
|
|
|
|
|
I resolved it. I declared the variables as extern. After removing extern in the variable declaration it built successfully.
|
|
|
|
|
Great!
Maxwell Chen
|
|
|
|
|
You say the class DIR_320 is coded in D320_DIS.cpp, but where is dir_320 ?
Iain.
|
|
|
|
|
That'll teach me to look at the forum, go away and do some actual WORK for a while, then answer a message...
Iain.
|
|
|
|
|
dear all,
I want help from you . I want to copy my mails which are in mailbox to the text file by program is anyone help me how can i do .
warm regards,
vaibhav
|
|
|
|