Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 09-14-2005, 04:23 AM   #1
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 ""

char *SERVER[20]="";
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
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 *""[20]="";

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


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 > Forums > Non-*NIX Forums > Programming

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

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