Daily Archives

Articles indexed Tuesday October 2 2012

Page 13/19 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Creating an update method in a different class

    - by Sweta Dwivedi
    I have created a class called 3D model which will animate my 3D model by changing the model position according to the values based in a .txt file through a list... Since i'm using a foreach loop to read the point values when it reaches the end of the file.. XNA throws an out of bounds exception .. (which is obvious) but if i add the same code in my Game.cs update(gameTime) method.. then i dont have this problem..Any idea how to make my 3D model update work same as the update in game.cs .. Here is the code for some idea: public void patterns(GameTime gameTime) { motion_z = new List<Point3D>(); if (pattern == 1) { f = "E:/Motion_Track-output/Output1.txt"; } if (pattern == 2) { f = "E:/Motion_Track-output/cruse.txt"; } // TODO: Add your update logic here using (StreamReader r = new StreamReader(f)) { string line; //Viewport view = graphics.GraphicsDevice.Viewport; int maxWidth = view.Width; int maxHeight = view.Height; while ((line = r.ReadLine()) != null) { string[] temp = line.Split(','); int x = (int)Math.Floor(((float.Parse(temp[0]) * 0.5f) + 0.5f) * maxWidth); int y = (int)Math.Floor(((float.Parse(temp[1]) * -0.5f) + 0.5f) * maxHeight); int z = (int)Math.Floor(((float.Parse(temp[2]) / 4 * 20000))); motion_z.Add(new Point3D(x, y, z)); } modelPosition.X = (float)(motion_z[i].X); modelPosition.Y = (float)(motion_z[i].Y); modelPosition.Z = (float)(motion_z[i].Z); i++; } //Console.WriteLine("modelposX:" + modelPosition.X + "," + "motionzX:" + motion_z[i].X); }

    Read the article

  • Change collision action

    - by PatrickR
    I have a collision detection and its working fine, the problem is, that whenever my "bird" is hitting a "cloud", the cloud dissapers and i get some points. The same happens for the "sol" which it should, but not with the clouds. How can this be changed ? ive tryed a lot, but can seem to figger it out. Collision Code - (void)update:(ccTime)dt { bird.position = ccpAdd(bird.position, skyVelocity); NSMutableArray *projectilesToDelete = [[NSMutableArray alloc] init]; for (CCSprite *bird in _projectiles) { bird.anchorPoint = ccp(0, 0); CGRect absoluteBox = CGRectMake(bird.position.x, bird.position.y, [bird boundingBox].size.width, [bird boundingBox].size.height); NSMutableArray *targetsToDelete = [[NSMutableArray alloc] init]; for (CCSprite *cloudSprite in _targets) { cloudSprite.anchorPoint = ccp(0, 0); CGRect absoluteBox = CGRectMake(cloudSprite.position.x, cloudSprite.position.y, [cloudSprite boundingBox].size.width, [cloudSprite boundingBox].size.height); if (CGRectIntersectsRect([bird boundingBox], [cloudSprite boundingBox])) { [targetsToDelete addObject:cloudSprite]; } } for (CCSprite *solSprite in _targets) { solSprite.anchorPoint = ccp(0, 0); CGRect absoluteBox = CGRectMake(solSprite.position.x, solSprite.position.y, [solSprite boundingBox].size.width, [solSprite boundingBox].size.height); if (CGRectIntersectsRect([bird boundingBox], [solSprite boundingBox])) { [targetsToDelete addObject:solSprite]; score += 50/2; [scoreLabel setString:[NSString stringWithFormat:@"%d", score]]; } } // NÅR SKYEN BLIVER RAMT AF FUGLEN for (CCSprite *cloudSprite in targetsToDelete) { //[_targets removeObject:cloudSprite]; //[self removeChild:cloudSprite cleanup:YES]; } // NÅR SOLEN BLIVER RAMT AF FUGLEN for (CCSprite *solSprite in targetsToDelete) { [_targets removeObject:solSprite]; [self removeChild:solSprite cleanup:YES]; } if (targetsToDelete.count > 0) { [projectilesToDelete addObject:bird]; } [targetsToDelete release]; } // NÅR FUGLEN BLIVER RAMT AF ALT ANDET for (CCSprite *bird in projectilesToDelete) { //[_projectiles removeObject:bird]; //[self removeChild:bird cleanup:YES]; } [projectilesToDelete release]; }

    Read the article

  • Character coding / programming

    - by Jery
    Lately I tryed a few times to create characters for some games, but at some certain point (especially when collision detection came in) everything became messy and the interaction between chars, the world and certain items had a lot of bugs. So here is my question, how do you ussualy keep track of actions that your character is allowed to do, or more in general do you have some links / advices how to set up a char efficiantly? I´m working on a char right now, who should at least be able to run, jump, pick items up and use different fighting animations. Most ideas I came up with until now use some kind of action.priority / action.duration system to determain whats possible and what not, or a "action-manager" which defines for every action what is possible from that action on but it all doesnt work that well together.

    Read the article

  • Is it possible to work with a dedicated server in XNA?

    - by Jake
    Hi I want to release my XNA game to the XBOX platform, but I'm worried about the networking limitations. Basically, I want to have a dedicated (authoritative) server, but it sounds like that is not possible. Which is why I'm wondering about: Using port 80 web calls to php-driven database Using an xbox as a master-server (is that possible?) I like the sound of #1, because I could write my own application to run on the xbox, and I would assume other users could connect to it similar to the p2p architecture. Anyone able to expand on theory #2 above? or #1 as worst-case scenario?

    Read the article

  • How to deal with OpenGL and Fullscreen on OS X

    - by Armin Ronacher
    I do most of my development on OS X and for my current game project this is my target environment. However when I play games I play on Windows. As a windows gamer I am used to Alt+Tab switching from within the game to the last application that was open. On OS X I currently can't find either a game that supports that nor can I find a way to make it possible. My current project is based on SDL 1.3 and I can see that cmd+tab is a sequence that is sent directly to my application and not intercepted by the operating system. Now my first attempt was to hide the rendering window on cmd+tab which certainly works, but has the disadvantage that a hidden OpenGL window in SDL cannot be restored when the user tabs back to the application. First of all, there is no event fired for that or I can't find it, secondly the core problem is that when that application window is hidden, my game is still the active application, just that the window disappeared. That is incredible annoying. Any ideas how to approximate the windows / linux behavior for alt+tab?

    Read the article

  • jCarousel jQuery ajax loading 1000 records

    - by user1714862
    I'm using jCarousel to present a vertical scolling list of +-1000 names. I am using ajax to load the data 100 records at a time then when all the data has loaded I just let the jCarousel loop in the DOM. I have the ajax and loop all working but would like to make the code work no matter how large the total record count becomes. 1) I'd like to eliminate the 1201 fixed number and use a variable. 2) I currently loop on every record I see (carousel.first) to see if it matches my reload position(s) (albeit the loop is ony 12x it still seems a little "loopy") Any suggestions on improving this? function mycarousel_itemLoadCallback(carousel, state) { //if (carousel.has(carousel.first, carousel.last)) { //return; //} var getCount = 100; // Number of records to grab at a time var maxCount = 1201; // total possible number of records var visible = 9; // the number of records you can see in the window so this creates a pre-load by this number of records for (var i = 1; i < maxCount; i+=getCount ) { if (carousel.first === 1 || carousel.first === (i-visible)){ var getFrom = i; var getTo = getFrom+(getCount-1); //alert('TOP Record ='+carousel.first+'\n Now GET '+getFrom+'-'+getTo); jQuery.get('#ajaxscript#', { first: getFrom, last: getTo }, function(xml) { mycarousel_itemAddCallback(carousel, getFrom, getTo, xml); }, 'xml' ); break; } } };

    Read the article

  • javascript variable evaluation in function

    - by lamerzpua
    I trying to use simile widget for own need but I'm stuck on such problem. I have loop for (i=0;i<15;i++){ Timeline.loadXML(function_that_return_url(), function(xml, url) { eventSource[i].loadXML(xml, url); }); } This code is for Timeline.loadXML: Timeline.loadXML = function(url, f) { var fError = function(statusText, status, xmlhttp) { alert("Failed to load data xml from " + url + "\n" + statusText); }; var fDone = function(xmlhttp) { var xml = xmlhttp.responseXML; if (!xml.documentElement && xmlhttp.responseStream) { xml.load(xmlhttp.responseStream); } f(xml, url); }; SimileAjax.XmlHttp.get(url, fError, fDone);}; When I open the page - my function function(xml, url) { eventSource[i].loadXML(xml, url); }); is passed to loadXML method which use it inside as f(xml, url); Problem is that i variable is not parsed as number and I receive message that eventSource[...] is not declared. How I can evaluate i values before it will be posted as argument for the method LoadXML ?

    Read the article

  • How to pass a parameter in a Javascript confirm function?

    - by Miles M.
    I have something like that in my code: <?php foreach($clients as $client): ?> <tr class="tableContent"> <td onclick="location.href='<?php echo site_url('clients/edit/'.$client->id ) ?>'"><?php echo $client->id ?></td> <td><a class='Right btn btn-danger' onClick="ConfirmMessage('client', <?php $client->id ?>,'clients')"> <i class="icon-remove-sign icon-white"></i> </a></td> </tr> <?php endforeach ?> that's actually the view. So when the user click on the delete button (thr one with the btn-danger class) I'd like him to confirm his choice with a javascript confirmation box message. You can find that script in the header <script> function ConfirmMessage(type, id, types) { if (confirm("Are you sure you want to delete this ",type," ?")) { // Clic sur OK document.location.href='<?php echo site_url(); ?>',types,'/delete/',id; } } </script> So here is my question: I would like the $type to be replaced by a paramenter (like client, article, post .. ) that I'll pass to the function. And i would like to get the $client-id parameter as well. I'm bad in javascript and as you already have guess, It is obviously not working at all.

    Read the article

  • Which CSS identifier is used for the selected tab in tabbed tables in browsers other than IE?

    - by David Navarre
    When you have a table on a form in Notes, you can choose to display only one row at a time (via the Special Table Row Display parameter on the Table Rows tab of the Table properties). In a Notes document displayed using Internet Explorer that contains such a table, a row is displayed with a cell for each "tab". The TD that serves as the tab for the selected "Notes table row" is assigned <td class="dominoSelTopTab">, while the other tabs get <td class="dominoTopTab">. However, when using other browsers, it's not nearly as simple. In Firefox, each "tab" ends up as a single-celled-single-row-table within the table with very little to identify it. <td><table border="1" cellpadding="2"> <tr><td><div align="center"><b>Tab 2</b></div></td></tr> </table></td> A non-selected tab would show as follows: <td><table border="1" cellpadding="2"> <tr><td><div align="center"><a name="1." href="/Projects/MyCSS.nsf/0c3b9489476440c085257a62006d97d6/d482a1767a4af77f85257a62006db064?OpenDocument&amp;TableRow=1.0#1." target="_self">Tab 1</a></div></td></tr> </table></td> So, the question is, how do I identify the selected tabs and the non-selected tabs when not using IE? Note: For those who are not Notes developers, the HTML is auto-generated from the visual design as laid out in the Notes designer client. I would replace it all with manual HTML, except there is so much of it that doing so would consume far too much time.

    Read the article

  • How to define an array inside a function in C?

    - by Arunav Dev
    So in my source file I have the folowin function: void update(state* old_state, state* measurement, uint32_t size) { state new_state[size]; //some function using measurement and old_state and returning the result in newstate arm_fadd_32(measurement,old_state,newstate,size); // rest of the code } Now the compiler throws an error saying that error#28:expression must have a constant value. I think it's due to the fact that even though inside the method the size local variable is not changing the compiler is expecting a constant while defining the size. I have tried the following: int const a = size; and then tried to reinitialize it says constant value is not known. I did some research in internet and it appears that there is no easier way without using malloc, which I don't want to since I am using the code for some embedded application. Is there a way to avoid this problem without really using malloc? Thanks in advance guys!

    Read the article

  • php - upload script mkdir saying file already exists when same directory even though different filename

    - by neeko
    my upload script says my file already exists when i try upload even though different filename <?php // Start a session for error reporting session_start(); ?> <?php // Check, if username session is NOT set then this page will jump to login page if (!isset($_SESSION['username'])) { header('Location: index.html'); } // Call our connection file include('config.php'); // Check to see if the type of file uploaded is a valid image type function is_valid_type($file) { // This is an array that holds all the valid image MIME types $valid_types = array("image/jpg", "image/JPG", "image/jpeg", "image/bmp", "image/gif", "image/png"); if (in_array($file['type'], $valid_types)) return 1; return 0; } // Just a short function that prints out the contents of an array in a manner that's easy to read // I used this function during debugging but it serves no purpose at run time for this example function showContents($array) { echo "<pre>"; print_r($array); echo "</pre>"; } // Set some constants // Grab the User ID we sent from our form $user_id = $_SESSION['username']; $category = $_POST['category']; // This variable is the path to the image folder where all the images are going to be stored // Note that there is a trailing forward slash $TARGET_PATH = "img/users/$category/$user_id/"; mkdir($TARGET_PATH, 0755, true); // Get our POSTed variables $fname = $_POST['fname']; $lname = $_POST['lname']; $contact = $_POST['contact']; $price = $_POST['price']; $image = $_FILES['image']; // Build our target path full string. This is where the file will be moved do // i.e. images/picture.jpg $TARGET_PATH .= $image['name']; // Make sure all the fields from the form have inputs if ( $fname == "" || $lname == "" || $image['name'] == "" ) { $_SESSION['error'] = "All fields are required"; header("Location: error.php"); exit; } // Check to make sure that our file is actually an image // You check the file type instead of the extension because the extension can easily be faked if (!is_valid_type($image)) { $_SESSION['error'] = "You must upload a jpeg, gif, or bmp"; header("Location: error.php"); exit; } // Here we check to see if a file with that name already exists // You could get past filename problems by appending a timestamp to the filename and then continuing if (file_exists($TARGET_PATH)) { $_SESSION['error'] = "A file with that name already exists"; header("Location: error.php"); exit; } // Lets attempt to move the file from its temporary directory to its new home if (move_uploaded_file($image['tmp_name'], $TARGET_PATH)) { // NOTE: This is where a lot of people make mistakes. // We are *not* putting the image into the database; we are putting a reference to the file's location on the server $imagename = $image['name']; $sql = "insert into people (price, contact, category, username, fname, lname, expire, filename) values (:price, :contact, :category, :user_id, :fname, :lname, now() + INTERVAL 1 MONTH, :imagename)"; $q = $conn->prepare($sql) or die("failed!"); $q->bindParam(':price', $price, PDO::PARAM_STR); $q->bindParam(':contact', $contact, PDO::PARAM_STR); $q->bindParam(':category', $category, PDO::PARAM_STR); $q->bindParam(':user_id', $user_id, PDO::PARAM_STR); $q->bindParam(':fname', $fname, PDO::PARAM_STR); $q->bindParam(':lname', $lname, PDO::PARAM_STR); $q->bindParam(':imagename', $imagename, PDO::PARAM_STR); $q->execute(); $sql1 = "UPDATE people SET firstname = (SELECT firstname FROM user WHERE username=:user_id1) WHERE username=:user_id2"; $q = $conn->prepare($sql1) or die("failed!"); $q->bindParam(':user_id1', $user_id, PDO::PARAM_STR); $q->bindParam(':user_id2', $user_id, PDO::PARAM_STR); $q->execute(); $sql2 = "UPDATE people SET surname = (SELECT surname FROM user WHERE username=:user_id1) WHERE username=:user_id2"; $q = $conn->prepare($sql2) or die("failed!"); $q->bindParam(':user_id1', $user_id, PDO::PARAM_STR); $q->bindParam(':user_id2', $user_id, PDO::PARAM_STR); $q->execute(); header("Location: search.php"); exit; } else { // A common cause of file moving failures is because of bad permissions on the directory attempting to be written to // Make sure you chmod the directory to be writeable $_SESSION['error'] = "Could not upload file. Check read/write persmissions on the directory"; header("Location: error.php"); exit; } ?>

    Read the article

  • bool - 255 value

    - by user994165
    I have this function defined: struct heap_validation { size_t num_alloc; size_t num_alloc_sz; struct memory *mem; }; ... bool get_isallocated(struct metadata_record *); When I call the heap_validation function from hashtable_traverse and print the result, I've gotten the following values: 0,255 ,246 void hashtable_traverse(struct metadata_record *metarec, struct heap_validation *heap_val) { printf("get_isallocated(metarec): %d\n",get_isallocated(metarec)); bool retrieved = false; bool allocated = get_isallocated(metarec); if (allocated) { heap_val->num_alloc += 1; I also tried with %d and I get the same result.

    Read the article

  • The meaning of tracking in git

    - by user273158
    In an article that has been cited in StackOverflow a few times (e.g. 1) , the author discusses the asymmetry between git push and git pull, and mentions the following: Update: Thanks to David Ongaro, who points out below that since git 1.7.4.2, the recommended value for the push.default option is upstream rather than tracking, although tracking can still be used as a deprecated synonym. The commit message that describes that change is nice, since it suggests that there is an effort underway to deprecate the term “track” in the context of setting this association with the upstream branch in a remote repository. (The totally different meanings of “track” in git branch --track and “remote-tracking branches” has long irritated me when trying to introduce git to people.) What is exactly the difference that he is referring to with: The notion of "tracking" in git branch --track The notion of "tracking" in remote-tracking branches in the last sentence?

    Read the article

  • Java: Converting UTF 8 to String

    - by kujawk
    When I run the following program: public static void main(String args[]) throws Exception { byte str[] = {(byte)0xEC, (byte)0x96, (byte)0xB4}; String s = new String(str, "UTF-8"); } on Linux and inspect the value of s in jdb, I correctly get: s = "ì–´" on Windows, I incorrectly get: s = "?" My byte sequence is a valid UTF-8 character in Korean, why would it be producing two very different results?

    Read the article

  • OpenGL multitexture tessellation

    - by user1715296
    I have to tessellate some surface in OpenGL with rectangular textures. Let it be a single triangle for simplicity. The textures touch each other by sides, and do not overlap. That is done by setting GL_TEXTURE_WRAP_S and GL_TEXTURE_WRAP_T to GL_CLAMP_TO_BORDER and adjusting texture coords properly. Everything goes fine while GL_TEXTURE_MIN_FILTER and GL_TEXTURE_MAG_FILTER is set to GL_NEAREST, but when I want to apply GL_LINEAR filering and/or anisotropic filtering following arifact apperas: textures border pixel's alpha gradually fall to transparent, so that line of background color is visible between neighbouring textures. How can I avoid this artifact without merging multiple textures to one while linear filtering is preserved?

    Read the article

  • In Vim, how to swap 2 non adjacent patterns?

    - by ThG
    I have lines of text, all with the same structure, and would like to make a permutation of 2 elements on all lines: 1257654 some text (which may be long) #Foo 1543098 some other text #Barbar 1238769 whatever #Baz 2456874 something else #Quux I want to obtain : #Foo some text (which may be long) 1257654 #Barbar some other text 1543098 #Baz whatever 1238769 #Quux something else 2456874 This is where I am stuck : :%s/\(\d\{7\}\)\(#.\{-}\)/\2\1/ Where did I go wrong ?

    Read the article

  • The glutKeyboardFunc does not react to key presses immediately

    - by Nibirue
    I have a function glutKeyboardFunc(keyboard), where keyboard has: void keyboard(unsigned char key, int x, int y){ float alpha = 1.0; switch(key){ case 'c': glClearColor(1,0,0,alpha); printf("success"); break; } } This is a summary of the function; it works properly, but only once some other action has occurred. For instance, the printf statement reports success immediately on keystroke 'c', but the background color does not become active until I click somewhere else on the canvas. I want all keystrokes to have an immediate effect.

    Read the article

  • Delegate Method only Firing after 5 or so Button Presses?

    - by CoDEFRo
    I'm having the most bizarre problem which I'm not even close to figuring out. I have a button which fires a delegate method. Once upon a time it was working fine, but after making some changes to my code, now the delegate method only fires after I push the button x amount of times (the changes I made to the code had nothing to do with the infrastructure that connects the delegate together). It varies, it can be 5 times to 10 times. I used the analyzer to check for memory leaks and there aren't any. There is too much code for me to paste here (I don't even know where to start or where the problem could be), but I'm wondering if anyone has experienced this problem before, or what could be causing it? This is very odd and have no clue what could be causing it.

    Read the article

  • How to deploy updates to .NET website in cluster

    - by royappa
    We are operating a corporate web application on a load-balanced cluster that consists of two identical IIS servers talking to a single MSSQL database. To deploy updates I am using this primitive process: 1) Make a copy of the entire site folder (wwwroot\inetpub\whatever) on each IIS box 2) Download the updated, compiled files onto each IIS box from our development area 3) Shut down IIS both web servers 4) Copy the new and updated files into the wwwroot folder (overwriting any same files) 5) Then restart IIS on both machines When there are database changes involved there are a few other steps. The whole process is fairly quick but it is ugly and fraught with danger, so it has to be done with full concentration. I would like to just push one button to make it all happen. And I want a one-click rollback in case there is a problem (that's the reason I make the copy in step #1). I am looking for tools to manage and improve this process. If it also helped us maintain a changelog, that would be nice. Thanks.

    Read the article

  • How to Create C++ Project Filter/Folder in Visual Studio?

    - by BSalita
    Using Visual Studio 2012, I'd like to create a C++ project folder called "Include Files", which has the same characteristics as the well known folder "Header Files". That is, the files in Include Files have a cpi extenson and will be parsed out for use with InteliSense, and also can be precompiled. I'm able to create the folder but files within it aren't parsed. I've tried setting the type to C++ Header file. Nothing seems to work. The files work fine when given a hpp extension and put into Header Files folder.

    Read the article

  • friend declaration block an external function access to the private section of a class

    - by MiP
    I'm trying to force function caller from a specific class. For example this code bellow demonstrate my problem. I want to make 'use' function would be called only from class A. I'm using a global namespace all over the project. a.h #include "b.h" namespace GLOBAL{ class A{ public: void doSomething(B); } } a.cpp #include "a.h" using namespace GLOBAL; void A::doSomething(B b){ b.use(); } b.h namespace GLOBAL{ class B{ public: friend void GLOBAL::A::doSomething(B); private: void use(); } Compiler says: ‘GLOBAL::A’ has not been declared ‘void GLOBAL::B::use()’ is private Can anyone help here ? Thanks a lot, Mike.

    Read the article

  • Oracle: show parameters on error

    - by llappall
    When Oracle logs a parameterized SQL query failing, it shows "?" in place of the parameters, i.e. the query before replacing parameters. For example, "SELECT * FROM table where col like '?'" SQL state [99999]; error code [29902]; ORA-29902: error in executing ODCIIndexStart() routine ORA-20000: Oracle Text error: DRG-50901: text query parser syntax error on line 1, column 48 Is there a way to change logging so it shows the parameter values? The information above is absolutely useless unless I can see what the actual parsing problem was. In general, is there a way to set logs in Oracle to show parameters in parameterized query errors?

    Read the article

  • need the right way to setcookie in wordpress

    - by jq beginner
    i've been looking the whole day how to setcookies in wordpress. in my way i found out (using the developer toolbar) that the cookie is set but still not working. i have 2 files the first contains the login form redirecting to another page to set the cookie and return to another page to check if it's working. domain which is tested on is like this : blog.mydomain.com. here's the setcookie file : <?php setcookie("user_name","test",time()+3600); ?> and chcking the cookie like this : if(isset($_COOKIE["user_name"])){ echo "cookie exists"; } else{ echo "cookie doesn't exist"; } i've read many topics about this issue but there was no clear answer. Thanks in advance

    Read the article

  • How to make my JavaScript code unusable by anyone else? [closed]

    - by egasimus
    Heh, that's something that many plugin authors do without needing help, isn't it? :) Here's the rub -- I'm coding a jQuery plugin which I have the intent to sell. I want to provide a live demo of it; of course, I don't want anyone just using the demo code. I know it's dumb, and it certainly doesn't bring any good karma, but what are some naughty things I can do in the demo script that would make life reasonably difficult for anyone trying to use it? Setting undefined = true comes to mind, as well as overriding jQuery methods. Any suggestions beyond that?

    Read the article

  • The Bizarre Hidden Powers of the Preprocessor? [closed]

    - by ApprenticeHacker
    The preprocessor in C and C++ deserves an entire essay on its own to explore its rich possibilities for obfuscation. It is true that the C++ (and C) preprocessor can be used for a lot of powerful stuff. #ifdefs and #defines are often used to determine platforms, compilers and backends. Manipulating the code likewise. However, can anyone list some of the most powerful and bizarre things you can do with the preprocessor? The most sinister use of the preprocessor I've found is this: #ifndef DONE #ifdef TWICE // put stuff here to declare 3rd time around void g(char* str); #define DONE #else // TWICE #ifdef ONCE // put stuff here to declare 2nd time around void g(void* str); #define TWICE #else // ONCE // put stuff here to declare 1st time around void g(std::string str); #define ONCE #endif // ONCE #endif // TWICE #endif // DONE This declares different things based on how many times the header is included. Are there any other bizarre unknown powers of the C++ preprocessor?

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19  | Next Page >