|
I thought that was a pretty good response...
|
|
|
|
|
That's just rude.
THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?!
-- C++ FQA Lite
|
|
|
|
|
Vaclav_Sal wrote: Apparently #define VERSION does not simply replace the VERSION with literal 1.0.0 but the 1.0.0 is analyzed by GCC compiler. When you use that statement the value after the word VERSION has two decimal points so it is not a valid token, and the compiler rejects it. A #define statement must contain valid C/C++ code, so the value after the identifier must be a valid literal or expression which resolves to a valid literal; see http://msdn.microsoft.com/en-us/library/teas0593.aspx[^].
|
|
|
|
|
My test (above) with Borland's compiler had no trouble -- provided I stringized the value. But there are better ways to skin that cat.
|
|
|
|
|
Same with Microsoft C++, as you would expect.
|
|
|
|
|
And VAX/DEC/HP C of course.
|
|
|
|
|
Thanks for the link Richard.
Here is the reason why it had too many decimal points
"The token-string argument consists of a series of tokens, such as keywords, constants, or complete statements."
It passes if the token string is just 1.0, but obviously it has to be correctly formatted for printf to display right.
|
|
|
|
|
when we are going to develop code c++
1.why we are using visual studio 2008
2.why we are using unix
3.why we need SQL commands
|
|
|
|
|
1. Because it is a good IDE for developing Windows/Web applications.
2. I don't know, why are you using Unix?
3. To access your database.
|
|
|
|
|
- You can use
Visual Studio for writing C++ applications targetting the Windows platforms. - If you are using
UNIX (or Linux ) then you are NOT using Visual Studio (and you are using a UNIX or Linux compiler, e.g. gcc ). SQL commands are used to deal with databases, see, for instance the SQL Wikipedia page[^].
THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?!
-- C++ FQA Lite
|
|
|
|
|
Hi Guys,
I have a small problem i hope you guys can help.
Actually i have an Win32 application which contacts to a cloud server and the communication between my client and server code is both the XML and json formats.
But can u suggest me some other formats where size of my code should be less and communication should be fast and reliable.
Any suggestions please.
Thanks in advance.
|
|
|
|
|
There is bson which is a binary json. Many software products use sqlite3 and sync it to their server. For example Skype. You can also create yourself a small TCP/IP based protocol.
- Michael Haephrati מיכאל האפרתי
|
|
|
|
|
Thanks Michael actually we are thinking of writing our own binary format will it be a good idea ?
|
|
|
|
|
That seems to be the best idea but it is also important to structure the data properly and sdqlite3 can be great for doing so. You can ofcourse encrypt the sqlite3 database file then.
- Michael Haephrati מיכאל האפרתי
|
|
|
|
|
Member 10813090 wrote: where size of my code should be less and communication should be fast and reliable.
And why is what you are currently doing a problem? Is there a measured bottleneck that you have determined is caused by your code?
|
|
|
|
|
Using Visual Studio 2013 C++, I got compilation errors that I couldn't explain.
The compilation errors were:
*main.cpp(325): error C2601: 'FLAG' : local function definitions are illegal
main.cpp(323): this line contains a '{' which has not yet been matched
main.cpp(326): fatal error C1075: end of file found before the left brace '{' at 'main.cpp(323)' was matched*
But there was nothing wrong with my code. I counted all brackets and the number matched. There weren't any function inside another function.
I solved it by removing all "//" comments from the source code. It seems that the reason for that is bad line formatting which causes the compiler to miss a line break, so the line after a comment is treated as a comment as well.
For example:
This_is_a_line;
is treated as:
There are many posts of the net about similar problems and some even suggested that they could be caused by a memory (RAM) fault on the machine, so before you replace your RAM, just remove the comments and see...
- Michael Haephrati מיכאל האפרתי
|
|
|
|
|
I assume this could be a codepage problem. There is an option under Tools/Options/Environment/Documents to save documents in Unicode. Maybe this has a side effect. Also if you (or someone else) edited the source file in some other editor that removed the carriage return from the line break, this could be a problem.
I would open the source file in an editor that can show the specific line endings (e.g. Notepad2). Maybe you see something unusual there.
The good thing about pessimism is, that you are always either right or pleasently surprised.
|
|
|
|
|
Thanks for the tips. I think one of the source files came from a Mac. Now when I place line breaks, get DEBUG messages, etc. it points to the wrong line and I don't know how to fix that.
- Michael Haephrati מיכאל האפרתי
|
|
|
|
|
Have you considered the possibility of a comment line containing a trigraph? See for example this article[^] on curious errors caused by accidental introduction of trigraphs in comment lines.
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
|
|
|
|
|
Is it possible to use the Visual Studio ribbon editor with classes that I derive myself from CMFCRibbon... classes?
For instance, is it possible to derive my own combo box from CMFCRibbonComboBox and then somehow get it into the toolbox so I can add it to my ribbon at design time?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Hi,
I am working in MFC application. I faced one problem in my application. This application is alread developed. It has CAlarm class it inherited CListbox like
class CAlarmList : public CListBox it displays value through DrawItem
void CAlarmList::DrawItem(LPDRAWITEMSTRUCT lpDIS)
{
int iListItem = lpDIS->itemID;
CDC lDC;
lDC.Attach(lpDIS->hDC); It working fine but not have header. but client looking header but CListbox not have header control how to add header please help me.
|
|
|
|
|
Might you try changing to a CListCtrl (that has a built in header)? or maybe add a CHeaderCtrl object just above the list box?
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
|
|
|
|
|
Hi all,
I'm working on a library of which I only want to distribute the .lib and a .h. The header defines the interface or api to the library, the idea being that the user does not bother much about the insides of it. However, I have a concept issue.
#include <map>
#include <string>
class MyApiClass{
public:
private:
std::map<std::string, Param> vars;
};
Obviously this throws an error saying Param is not defined when I compile another application that includes libApi.h and links the library. The thing is, the class Param is declared in Param.h and defined in Param.cpp, files that I don't want the user to play with.
What are my options??
Thanks in advance.
paul.
modified 9-Oct-14 10:12am.
|
|
|
|
|
What's wrong in including param.h in MyApiClass source file?
THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?!
-- C++ FQA Lite
|
|
|
|
|
well... the application in which I use the lib won't compile, will it?? Or am I missing something?
Including param.h in libApi.cpp , when compiling the application
#include "libApi.h"
void main (void)
{
}
I get an error saying "libApi.h: 'Param' undeclared identifier"
|
|
|
|