|
please read the forum guidelines ("how to ask a question"), use PRE tags, ask a specific question and provide symptoms if it does not do as you would like.
Suggestion: If it does not work, start with something simpler; do not enter 20 lines of code if you are not experienced enough to get the first 5 to work as expected.
And do you really want to enter up to 250 characters one by one?
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
What should I do?
Can you help me on this method...
|
|
|
|
|
it is not clear what you want.
it is clear this is one of your very first attempts at programming; if it does not work, start with something simpler.
Do not start with 2-dimensional arrays, until you know everything there is to know about one-dimensional ones.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Im only guessing but..
Look at comments in the code.
Once you press enter, it exits the nested for loop and prints out what you put in.
#include <stdio.h>
#include <conio.h>
int main()
{
int i,j;
char list[80][20]={'\r' };
printf("\n input some chars ..\n\n ");
for(j=0;j<1;j++)
{
for(i=0;i<50;i++)
{
list[i][j]=getchar();
printf("%c = %d ",list[i][j],(int)(list[i][j]) );
if ( (int) (list[i][j]==10) )
{
printf("\n User pressed Enter: new line .. ");
break;
}
}
}
printf("\n\nListing..\n");
for(j=0;j<5;j++)
{
for(i=0;i<50;i++)
{
printf("%c",list[i][j]);
}
printf("\n");
}
printf("\n");
return 0;
}
......
|
|
|
|
|
When you create your arrays you're not initialising the contents to anything. Have a look at the rules for initialising automatic arrays in C and you might see what's wrong.
Get in the habit of initialising all variables as you declare them, it'll save loads of tears.
Cheers,
Ash
|
|
|
|
|
Since you stop collecting inputs at first newline but then ouput the whole array content, some resulting garbage is inevitable, I suppose.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hello all.
I want to define an array in c win32 console. First column should be name & family of students and other columns should be grades of them.
NOW HELP ME : How can I have this array with first string column and other columns in float.
Thanks in advance.
|
|
|
|
|
Create a structure with name and grades as members.
struct _tagStudent
{
char Name[256];
float Math;
float Science;
}; Now you can create an array of Students.
struct _tagStudent Student[100];
You can access the members as follows -
Student[0].Name;
Student[0].Math;
Student[25].Name;
Student[25].Science;
|
|
|
|
|
how to know the parent item of a child tree item.
and how to traverse from last child item to root parent item.
|
|
|
|
|
1- GetParentItem ( HTREEITEM );
2- you'd loop over the items returned by GetParentItem until the item is TVI_ROOT (or something like that)
Watched code never compiles.
|
|
|
|
|
Sakhalean wrote: how to know the parent item of a child tree item.
and how to traverse from last child item to root parent item.
What do you have, i mean where do u struck? do you have HTREEITEM of child?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
|
Sakhalean wrote: yes i have HTREEITEM
To Find Parent TreeItem:
call GetParentItem(child tree item)
To Find Root TreeItem:
HTREEITEM child = HTREEITEM of child;
HTREEITEM root = NULL;
do
{
root = GetParentItem(child);
child = root
}
while(root != NULL);
root will contain root tree item
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
|
|
Have u tried SetForegroundWindow??
|
|
|
|
|
Yes I had tried but that was not working so I was asking here
|
|
|
|
|
Did you only use SetForegroundWindow or combination of SetForegroundWindow and SetWindowPos???
Try This..
Sleep(5000);
::SetForegroundWindow(this->m_hWnd);
::SetWindowPos(this->m_hWnd, HWND_TOPMOST,0,0,0,0, SWP_NOMOVE | SWP_NOSIZE);
|
|
|
|
|
I had only used SetForegroundWindow. Yup! This combination is also working.
|
|
|
|
|
rahul.kulshreshtha wrote: Yup! This combination is also working.
What else is working?
|
|
|
|
|
Check out my first reply.
It is also working
Sleep(5000);
::BringWindowToTop(this->m_hWnd);
::SetWindowPos(this->m_hWnd, HWND_TOPMOST,0,0,0,0, SWP_NOMOVE | SWP_NOSIZE);
::SetWindowPos(this->m_hWnd,HWND_NOTOPMOST,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE);
Third line is to make it NoTopMost otherwise it will be always on Top.
|
|
|
|
|
Hello all,
I have a question, Can we install IIS in client system programmatically? , If yes then i will appreciate some links and answers regarding that.
Regards
Ashish
|
|
|
|
|
Which version of IIS do you intend to install?If it is IIS6 see here.
[EDIT]
In addition this may be useful too.
[/EDIT]
Life is a stage and we are all actors!
|
|
|
|
|
Thanks for your reply, But i intend to install IIS version 5.1..
|
|
|
|
|
I've found that for IIS 5.1 .
Life is a stage and we are all actors!
|
|
|
|