LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-14-2005, 04:23 AM   #1
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Rep: Reputation: 45
override defines


Hi is it possible to override a define statement in c?
for example #define SERVER "192.168.1.10"

char *SERVER[20]="192.168.1.10";
and if the programmer dont give value to the char *SERVER then to use the default one?
 
Old 09-14-2005, 10:40 AM   #2
addy86
Member
 
Registered: Nov 2004
Location: Germany
Distribution: Debian Testing
Posts: 332

Rep: Reputation: 31
Your code fragment doesn't make sense: you define SERVER to be a string, and then you declare a variable with the name "SERVER"? After expanding, you variable declaration looks like this:
char *"192.168.1.10"[20]="192.168.1.10";

What do you want to achieve? If you want to undefine a macro, do this:
#undef SERVER
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
typedef defines which type? kpachopoulos Programming 1 11-10-2005 02:46 AM
OS Conditional Defines kevin.cowley Programming 1 09-24-2003 03:54 PM
What kind of Video Card Defines me as a Person? PrimaryDataLoop Linux - Hardware 5 07-09-2003 02:24 PM
Which configuration file defines the driver module for network card? yuzuohong Linux - General 1 06-04-2003 08:44 AM
File that defines root command prompt? WeNdeL Linux - Newbie 6 11-20-2002 12:28 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration