|
Please try providing a bit more information about your problem, otherwise none will be able to help you.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
It will happen automatically for controls on a modal dialog box that have the WS_TABSTOP style. For other windows use the IsDialogMessage[^] function.
Steve
|
|
|
|
|
|
|
Please give more detail of your problem, this question is not clear.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Im trying to read a file, containing Strings n integers..
please help me to only to read the integers and find the total marks
file contain 10 students names and marks ,each in a line and students name and marks separated by a comma .
eg:
John,89
Katharin,78
F.R.Majeed
|
|
|
|
|
This sounds like a course assignment...
Think about it logically:
x - Find a way to read the file line by line
x - What could you do when you obtain a line?
x - Is there a way to split the line apart, maybe separate name and mark?
x - When you find a way to separate them, it is simply the case of casting the string to an int and visa versa.
If you get really stuck here is a nice link of tools you could use to help with the string:
http://www.cplusplus.com/reference/string/string/[^]
|
|
|
|
|
venomation wrote: it is simply the case of casting the string to an int and visa versa.
You cannot cast a string to an int , it must be converted.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
@ venomation what u mention above could be done through oop language but i want to know how to do it through C (sop)
|
|
|
|
|
Doing this with C language programming is not difficult; just a few statements.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Have you considered fscanf() ?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
fp=fopen("SDetails.txt","r+");
while(1)
{
ch=fgetc(fp);
if(ch==EOF)
break;
fscanf(fp, "%d", &myInt);
printf(" %d ",myInt);
sum=sum+myInt;
}
printf("%d",sum);
fclose(fp);
what i did was like above ..but it print the same int 3 times ..i cant find the error...please help
now i can read only ints from the file..thx
|
|
|
|
|
What you have will never work as you expect. The call to fgetc() is going to advance the file pointer, then fscanf() is going to be reading from the middle of some byte. Have you checked the return value from fscanf() ? If it does not find a number to read from the file, it may be retaining the last read value.
Is your file laid out something like:
Name1,288,7099,441
Name2,1500
Name3,587,208
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
and not when i create the window .
thanks
i found what i need is call WS_DISABLED
but how i set this parameter on a button.again not when i create this window but after
nevermind i just create the window again when i get in the function with disable and when i finish i create again the window without disable
modified 14-Jan-12 18:31pm.
|
|
|
|
|
To disable a button (or any window or control) after it has been created, use the EnableWindow(hButton, FALSE); API call.
To get the handle to the button, use the GetDlgItem API.
|
|
|
|
|
I can't seem to get the function pointers working?
anybody see what's wrong? I just want to call the print()method
#include "stdio.h"
class TMyClass
{
public:
void print(){ printf("Print!\n"); };
void (TMyClass::*pt2Member)();
TMyClass(void);
};
TMyClass::TMyClass(void)
{
pt2Member = &TMyClass::print;
};
int main(int argc, char* argv[])
{
TMyClass instance1;
instance1.pt2Member;
return 0;
}
|
|
|
|
|
To call a member function using pointers you have to use the pointer to member operators (.* or ->* or ::* ).
But declaring the function pointer inside the class is not very helpful.
Usually the function pointer is declared outside the class like this -
void (TMyClass::*pt2Member)() = &TMyClass::print;
The above declaration may be done globally or inside the main function.
In this case, the function call would be as follows -
TMyClass instance1;
(instance1.*pt2Member)();
If, however, you do wish to declare the pointer inside the class like you've done here, the calling syntax would be a little weird and would look like this -
TMyClass instance1;
(instance1.*instance1.pt2Member)();
|
|
|
|
|
you earned your title 'superman'
thank you!!! works like a charm
|
|
|
|
|
Hello,
What i have is a video stream coming in, for every incoming frame i have to calculate the frame histogram and to display it graphically in the GUI.
So i have to redraw the histogram on the GUI every frame.
My problem is that i don't know how to draw the histogram,what controls to use,what functions or classes can help me?
Thanks.
|
|
|
|
|
|
Hi Developers,
I am using a MDI based application. I am trying to open a view and it's showing the background image on it. It's like overlaps it's own screen and background screen. I have not used any drawing function at all.
Can any one help me.
Thanks in Advance.
Amrit Agrawal
Software Developer, Mumbai
|
|
|
|
|
Amrit Agr wrote: it's showing the background image on it. It's like overlaps it's own screen and background screen.
I am having difficulty visualising exactly what you are seeing. Rather than 'it' can you explain which part of each window is showing what values. What do you see in the Main window, what do you see in the View, and where is the background from?
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
i want to print two parameter from my struct but it doesnt print to me
GetWindowText(hwndEdit[0],arr.last,10);
GetWindowText(hwndEdit[1],arr.first,10);
MessageBox(hwnd,TEXT((LPCWSTR)arr.last(LPCWSTR)arr.first),TEXT("bla"),MB_OK);
how can i fix\what is the syntax ?
|
|
|
|
|
You can only pass a single string to the MessageBox() function. Use sprintf() or the appropriate variant to create a single character array containing your complete message.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Hi,
The problem is with your conversion..
Cheers
|
|
|
|