473,775 Members | 2,290 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

i got "error C2099: initializer is not a constant" need help

montzter
15 New Member
Hi,

Got some declarations below but when I compiled it I got the above mentioned error.
1. I'd like to know if my implementation or stucture is doable.
2. How could i fix the problem...? Suggestions?

Thanks.

//code
typedef struct SomeStructTag
{
char* vOrigString;
char* vDestinationStr ing;
void (*pfnFuncPtr)(c har* a, char* b);
}SomeStructType ;

//*************** *************** *************
static SomeStructType globalVar[] =
{
((char*)"N", (char*)"Name :", SomeHandleFunct ion1),
((char*)"F", (char*)"Frog :", SomeHandleFunct ion2)
};
Dec 13 '06 #1
2 4700
horace1
1,510 Recognized Expert Top Contributor
try replaceing () with {}, e.g.
Expand|Select|Wrap|Line Numbers
  1. static SomeStructType globalVar[] =
  2. {
  3. {(char*)"N", (char*)"Name :", SomeHandleFunction1},
  4. {(char*)"F", (char*)"Frog :", SomeHandleFunction2}
  5. };
  6.  
  7.  
Dec 13 '06 #2
montzter
15 New Member
try replaceing () with {}, e.g.
Expand|Select|Wrap|Line Numbers
  1. static SomeStructType globalVar[] =
  2. {
  3. {(char*)"N", (char*)"Name :", SomeHandleFunction1},
  4. {(char*)"F", (char*)"Frog :", SomeHandleFunction2}
  5. };
  6.  
  7.  

Waaaaaaaaaaaaaa h. I missed that one. Thanks!!!!
Dec 15 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
12297
by: viditm | last post by:
Hi I keep getting the error "Error Creating Windows Handle" in my application and different places in the code. This occurs only to certain users. Its very random and cannot be reproduced in the development environment. I have an applicatin error logger which shows this error occuring (in the stack trace dump) but it again occurs at different locations in the code and occurs inconsistently. If anyone knows why it occurs or what can be...
6
3252
by: DraguVaso | last post by:
Hi, In my application, on some given actions while debugging in Visual Studio, I suddenly get a "System.ComponentModel.Win32Exception was unhandled" Message="Error creating window handle." exception. The problem is that this exception isn't raised somewhere in a method, so it just shows up, and it causes the application to shut down. Is there anyway how to catch this kinds of exceptions? Can I put somewhere a
3
8350
by: Vidit | last post by:
Hi I keep getting the error "Error Creating Windows Handle" in my application and different places in the code. This occurs only to certain users. Its very random and cannot be reproduced in the development environment. I have an applicatin error logger which shows this error occuring (in the stack trace dump) but it again occurs at different locations in the code and occurs inconsistently. My application is a windows forms...
1
8610
by: Flack | last post by:
Hey guys, Here is whats happening. I have a StringBuilder, a TextBox, and a TabControl with one TabPage. On my main form, I created and displayed a fairly big maze. While the app is solving the maze, it appends each step it takes to the StringBuilder. When the maze is solved, the user can click a menu item to display the results. When the menu item is clicked, I set the TextBox Text value using the StringBuilder's ToString()...
1
1629
by: Charlie | last post by:
Hi: Getting this error. Not sure what to do. App won't compile. Looks like it is something out of my control. Error 1 Metadata file 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\biolabnet\4bfeaa1c\ff23cac2\App_Web_filtercat.ascx.cdcab7d2.ehc-pwme.dll' could not be found
13
27441
by: hn.ft.pris | last post by:
Hi: I have the following simple program: #include<iostream> using namespace std; int main(int argc, char* argv){ const double L = 1.234; const int T = static_cast<const int>(L); int arr;
2
2664
by: semutmerah | last post by:
hi.. my english maybe wrong.. but hope somebody can understand me :) I did created 3 forms. "MainForm" , "CalForm" , "WaitForm". On "MainForm", I did put a command button called "Run". On "CalForm", there were some unbound "text box" which have some calculation
2
5175
by: tvnaidu | last post by:
I am getting this error for line 108, I kept C code also below, any idea?. main.c:108: underscore in number main.c:108: syntax error before numeric constant 104: #define EXPAND_CONCAT(name1,name2) name1 ## name2 105: #define CONCAT(name1,name2) EXPAND_CONCAT(name1,name2) 106: #define RT_MODEL CONCAT(MODEL,_rtModel)
3
13105
by: lingjun | last post by:
Hi, I am taking my first programing course in college... and I am completely lost on this assignment. I am not sure what is wrong with my current code. Any help will be appreciate it... thanks! I keep on getting the follow error messages when I try to compile it. test.c:3: error: syntax error before numeric constant test.c: In function `main': test.c:18: error: `next_day' undeclared (first use in this function) test.c:18: error:...
0
9622
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10109
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10051
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9916
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8940
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7464
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6718
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5361
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2854
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.