|
Oh ok I see what your saying. I find it kinda hard to believe I missed that in all the time I have spent using C++ Thanks for the help and explanation.
|
|
|
|
|
It's definitely incorrect syntax for a cast, and a cast was definitely unnecessary; my only doubt is whether or not it executes a constructor the way you'd written it. Like I said, I'm a bit rusty.
|
|
|
|
|
try this -
scanf("%[^\n]", MyString);
|
|
|
|
|
Hello, in my application there are 864 variables associated to each control(edit boxes and radio buttons), when the application is started, all this variables must to be updated from a file. So it's a lot of work to type all this code, my question is: is there any possibility to use a matrix (in this case will be 3 or more) in which each element will be a variable of each control? how can i do this?
|
|
|
|
|
Create a structure and put all the variables or references/pointers to the variables in the structure.
Now you can read the entire file into this structure in a single read.
You will still have to type in this code unless you have a great speech recognition engine that can understand and translate what you speak or better still, some AI module that can type what you think.
|
|
|
|
|
i m facing problem in linking of dll file of ACR-View in VC++, the template to be used is MFC. kindly list step by step procedure.ACR-View can be downloaded from http://www.parkermotion.com/scripts/support_downloads.asp, plz help
|
|
|
|
|
rahul1167 wrote: kindly list step by step procedure
Sorry, but that is not how it works.
Please describe what you have done - including any relevant code, and what is not working - including any error messages. Also note that if you are using a third party product (I assume ACR-View is third party) then you should try the producer web-site for help in the first instance.
Please also read the guidelines at the top of this page.
|
|
|
|
|
rahul1167 wrote: kindly list step by step procedure.
Of what? Are you wanting to implicitly link to the DLL (via the LIB file), or explicitly link (via LoadLibrary() ) to it?
"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
|
|
|
|
|
I need to use the functions of ACR-View for motion control, It is a software provided by parker automation for motion control. I am new to programming so i don't know what kind of linking is required, plz help if possible suggest ways for both type of linking I will try
|
|
|
|
|
rahul1167 wrote: I need to use the functions of ACR-View for motion control, It is a software provided by parker automation for motion control.
Isn't there any kind of documentation provided with the dll ? Reading this documentation would obviously be the first step...
|
|
|
|
|
rahul1167 wrote: I am new to programming so i don't know what kind of linking is required...
It all depends on which of the DLL, LIB, and H files you have.
"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 all,
I am using CComBSTR as a parameter by reference in a WebService method ,
this variable is supposed to fetch data from Webservice,But if huge buffer data is there then data is currepting. I mean I am getting incomplete buffer.
lease help me.
Thanks & Regards,
|
|
|
|
|
Is there any solution for the above problem..
Please help me.
|
|
|
|
|
Hello:
My application (C++ / MFC) uses the the microsoft Jet engine and the DAO classes to read and write microsoft access files.
Under Windows-7 the Jet engine is not available (except in XPMode).
Is there a quick and easy way to allow my application to continue reading and writing access files without the use of the microsoft jet engine? Do I need to remove the DAO classes and completely rewrite this part of the application?
Thanks
BobVal
|
|
|
|
|
Hi,
Im looking for a bit of guidance on this. I have a project for college for network design. It is to implement a C program for the breadth first search algorithm.
I can program in c but this is really confusing me, iv seen examples but they are hard to follow. Please see the brief below. Just need a push in the right direction to get started not the whole thing thanks.
BRIEF:
Implement Moores + Breadth First Search algorithm
-Input a list of edges in the format
{A, B}
-Where A, B are integers.
-The application should return
* Shortest path between a pair of user selected nodes.
* A spanning tree for the network.
Estimate the performance of the algorithm as a function of no of edges in the input list.
(I.e. time no of top level operations, memory usage etc)
|
|
|
|
|
|
I agree that the web is a good source of information on this issue. For example, you could look at the following URL: http://en.wikipedia.org/wiki/Dijkstra's_algorithm
There are several text books that discuses this issue as well. One book that comes to mind is "Introduction to Algorithms" by Cormen, Leiserson, Rivest and Stein. This book is not particular easy to follow but it does a very good job of analyzing the running time of the algorithms it discuses.
Bob
|
|
|
|
|
Hi everyone i'm stuck again on my program. I got to be honest to I feel like and idiot asking for help on something that I bet is so simple to most of you, anyway I have posted my code below. I was hoping someone could tell me why it does not compile.
#include<stdio.h>;
const float lowrate=2;
const float highrate=5;
const float taxrate=20;
int balance,threshold,total,interest,tax;
main()
{
printf("\n\n\t\tInput account balance ");
scanf("%d",&balance);
if (balance<threshold)
interest=balance*lowrate/100;
else
interest=balance*highrate/100;
total=balance+interest;
if tax is Y
tax=interest*taxrate/100;
total=total-tax;
getchar();
printf("\n\n\t\tInterest rate %20d", taxrate);
printf("\n\n\t\tInterest added %20d",interest);
printf("\n\n\t\tTax deducted %20d", tax);
printf("\n\n\t\tTotal account balance %17d",total);
getchar();
}
|
|
|
|
|
Please read the posting guidelines at the top of this forum before posting (use the code tag when submiting code and use a relevant title). Also, putting the error messages you get is helps a lot (thery are there for a reason you know).
Anyway, this line is invalid:
Ev3nflow wrote: if tax is Y
There is no "is" keyword in C++ and you forgot the paranthesis. Furthermore, Y has never been declared before.
|
|
|
|
|
Hi thanks for your help I dont mean to come across as such an amature I just want to get my work done cheers
|
|
|
|
|
Ev3nflow wrote: main()
int main()
Ev3nflow wrote: if tax is Y
is this supposed to be a comment (hopefully it is)? add "//" in front of it.
Also, you should get in the habit of initializing variables after you declare them, it looks as though you're using 'threshold' without it being initialized. When posting code please use code tags.
|
|
|
|
|
Ev3nflow wrote: printf("\n\n\t\tInterest rate %20d", taxrate);
printf("\n\n\t\tInterest added %20d",interest);
printf("\n\n\t\tTax deducted %20d", tax);
Why are you not using the %f format specifier?
"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
|
|
|
|
|
Well, he did define interest and tax to be int. Why? I don't know.
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
Ev3nflow wrote: #include;
The include statement needs a filename to include, such as:
#include "file1.h"
or
#include <file2.h>
[modified]
Nevermind, I see what happened to the filename. The HTML gods ate it.
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
Hi thanks to all who have help me. I have changed my code, and it seems to compile but I still get a warning 14 [Warning] converting to `int' from `float' I have pasted my code below
#include <stdio.h>;
const float lowrate=2;
const float highrate=5;
const float taxrate=20;
int balance,threshold,total,interest,tax,taxed,Y,is;
main()
{
printf("\n\n\t\tInput account balance ");
scanf("%d",&balance);
if (balance<threshold)
interest=balance*lowrate/100;
else
interest=balance*highrate/100;
total=balance+interest;
if (taxed) is; 'Y';
tax=interest*taxrate/100;
total=total-tax;
getchar();
printf("\n\n\t\tInterest rate %20d", taxrate);
printf("\n\n\t\tInterest added %20d",interest);
printf("\n\n\t\tTax deducted %20d", tax);
printf("\n\n\t\tTotal account balance %17d",total);
getchar();
}
|
|
|
|