|
help, i would like to know what was ARRAY is!!
please clarify!! thank you
|
|
|
|
|
Please go through this[^]
|
|
|
|
|
thank you so much!!!!
do you know some site for array using c language, not c++??
|
|
|
|
|
cool_joy2 wrote: do you know some site for array using c language, not c++??
Am not sure whether this may ruin you ; please click do a click here[^]
As suggested by the other posts, please consider reading some basic article/books in C or C++
|
|
|
|
|
no.. it doesn't ruin me!!
what you try to figure out is to search it in google right???
yah!! i know how to do it!!!
what i'm just asking for, whether you know some site which is in C not in C++ language discussion!!!
get it????
|
|
|
|
|
Please read more books on basics of programming as well as C.
Please do that first.
Величие не Бога может быть недооценена.
|
|
|
|
|
cool_joy2 wrote: help, i would like to know what was ARRAY is!!
Can you not use a dictionary? It's not even a programming-specific term.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Hi,
Can I pass a string with some %s in it as first parameter in printf/sprintf.
something like bellow
char str[16]="my name is %s";
char name[8]="xman";
char res[24];
sprintf(res,str,xman);
printf("%s",res);
can we achieve this?
Saadhinchaali
|
|
|
|
|
|
thank you David. It solved my problem
Saadhinchaali
|
|
|
|
|
Don't have access to a PC right now ?
|
|
|
|
|
of course
You know some birds are not meant to be caged, their feathers are just too bright.
|
|
|
|
|
sprintf(res,str,xman);
here xman is undeclared identifier..
|
|
|
|
|
suthakar56 wrote: here xman is undeclared identifier..
What do you expect? You did not declare that variable.
|
|
|
|
|
Tritva wrote: can we achieve this?
Have you tried?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
In my applcation,i have created two listbox in the view class.But initially only one listbox shoud be displayed,by pressing the button in menu..both first and second listbox will bedisplayed one below the another.
I do not know how to hide the listbox initailly.
int CAlarmView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
pAlrmListBox->Create(WS_CHILD|WS_VISIBLE|LBS_STANDARD|WS_VSCROLL|LBS_OWNERDRAWVARIABLE , CRect(0,0,600,400), this, ID_ALARMLIST);
.
.
pAlrmFilterBox->Create(WS_CHILD|WS_VISIBLE|LBS_STANDARD|WS_VSCROLL|LBS_OWNERDRAWVARIABLE , CRect(0,0,600,200), this, ID_ALARMLIST);
}
Anu
|
|
|
|
|
Remove WS_VISIBLE flag from Create(...). Use ShowWindow() API to make the listbox visible later.
|
|
|
|
|
bool Message::unpack() {
struct tuple{
qint32 op;
union {
qint32 val;
quint32 uval;
};
};
changeByteOrder();
//no data?
if (data() == NULL)
return false;
//invalid header?
if (*(qint32 *)data() != VALID_DGM)
return false;
//<b>skip header--- here is my problem i need the source ip </b>
<b> tuple *pt = (tuple *)(data() + 4); </b>
//reset active sensors
actSens = 0;
//read all sent values
for (int i = 4; i < size(); i+=sizeof(tuple)) {
switch (pt->op) {
case OP_TSLEEP:
tsleep = pt->uval;
break;
case OP_TRECV:
trecv = pt->uval;
break;
case OP_ID:
id = pt->uval;
break;
case OP_TEMP:
temp = pt->uval;
actSens |= SENSOR_LINE_TEMP;
break;
case OP_AI0:
ai0 = pt->val;
actSens |= SENSOR_LINE_A0;
break;
case OP_AI1:
ai1 = pt->val;
actSens |= SENSOR_LINE_A1;
break;
case OP_AI2:
ai2 = pt->val;
actSens |= SENSOR_LINE_A2;
break;
case OP_DIO0:
dio0 = pt->uval;
actSens |= SENSOR_LINE_DIO0;
break;
case OP_DIO1:
dio1 = pt->uval;
actSens |= SENSOR_LINE_DIO1;
break;
case OP_DIO2:
dio2 = pt->uval;
actSens |= SENSOR_LINE_DIO2;
break;
case OP_DIO3:
dio3 = pt->uval;
actSens |= SENSOR_LINE_DIO3;
break;
case OP_CURRENT:
current = pt->uval;
actSens |= SENSOR_LINE_CURRENT;
break;
case OP_VOLTAGE:
voltage = pt->uval;
actSens |= SENSOR_LINE_VOLTAGE;
break;
case OP_VBATT:
vbatt = pt->uval;
actSens |= SENSOR_LINE_VBATT;
break;
case OP_RSSI:
rssi = pt->val;
actSens |= SENSOR_LINE_RSSI;
break;
case OP_LAST_ACK:
lastAck = pt->uval;
break;
default:
break;
//cout << "UNKNOWN VALUE" << endl;
}
pt++;
}
return true;
}
i would like to not skip header so i can get source ip
|
|
|
|
|
Hi,
I have an application that controls a hardware system including a camera. I have noticed (after studying the logs) that when the application is running the system clock loses time gradually over an hour and then catches up the lost time in one stroke. This causes a big jump - 2 to 3 minutes - in the log times. To futher validate my theory I ran perfmon.exe and configured it to capture CPU usage every 30 seconds. In the log generated by perfmon I notice the same jump in the time.
Another interesting fact is that the interval between 2 jumps is exactly 1 hour. I have tried shutting down unnecessary services/processes to reduce the number of processes that are running but the problem still persists.
I'd appreciate any feedback and/or solutions
|
|
|
|
|
Member 519651 wrote: I have an application that controls a hardware system including a camera.
Is your application blocking the interrupt system in any way, so preventing clock ticks from being seen?
Does this happen when your application is not running?
|
|
|
|
|
I don't handle clock interrupt in my application but may be one of the drivers (camera) does. I wrote a sample app to display the values returned by GetSystemTimeAdjustment and found that the interval and increment values are 15.625 ms and that adjustment is disabled. The MSDN help says that when time adjustment is disabled then the clock will synchrnoize using "other mechanism" and make a noticeable jump.
I am guessing that the system clock is synchronizing every hour to the RTC on the motherboard. The questions I have is:
1. Why is it syncing exactly every hour?
2. What can I do to make it sync say every 10 minutes or so?
I'd appreciate any thoughts/ideas on this matter.
|
|
|
|
|
Member 519651 wrote: 1. Why is it syncing exactly every hour?
No idea I'm afraid. I have never seen this problem, and Google does not seem to have any relevant hits. You may like to try some of the Microsoft forums to see if anyone has the answer. It may be something connected to your specific hardware configuration, in which case you need to talk to the manufacturer.
|
|
|
|
|
Member 519651 wrote: ...I ran perfmon.exe and configured it to capture CPU usage every 30 seconds. In the log generated by perfmon I notice the same jump in the time.
Which would indicate it has nothing to do with your code or this forum, correct?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
It happens only when my application is running. I ran perfmon in parallel to my application to see if this is really happening and not some bug in the logger code.
|
|
|
|
|
Member 519651 wrote: It happens only when my application is running.
Hi,
Usermode applications should have no effect on the system clock. I would suspect that a device driver may be effecting the clock interrupt.In fact... what you are describing sounds somewhat normal. What you are descibing is called clock crystal drift.
You should investigate the GetSystemTimeAdjustment Function[^] if you want to attempt to compensate for the clock drift.
If you need a higher resolution clock... then you may need to purchase special hardware. Its as simple as that.
Anyway here is what Larry Osterman had to say about it:
One in a million redux[^]
Best Wishes,
-David Delaune
|
|
|
|