Is the 'C' language acting differently for all the SDK(VisualStudio,xCode...)?

Hi guys~!
I've been in a dazed since i started writing this piece of code as an example since i'm still learning 'C' programming in the Poly's. Is the 'C' language acting differently while is on another platform?
When i wrote this using VS, it works, but when it comes to Xcode, it's not going to provide me the right output.
#include <stdio.h>
#include <ctype.h>
int main(int argc, const char * argv[])
    int x, num = 0;
    char choice;
    printf("Number\n");
    for (choice = 'Y'; choice == 'Y'; num++)
        for (x = 1; x <= 4; num++)
            printf("%6d\n", x);
            x++;
        } // end for
        printf("\nWould you like to continue the loop? Y/N?: ");    < - - It ignored the user key and skipped out of the loop, and proceed with the final output.
        fflush(stdin);
        scanf("%c", &choice);
        choice = toupper(choice);
    } // end for
    printf("Thank you for your participation~! Have a nice day & See you!");
} // end main

Code the scanf like this:
scanf(" %c", &choice);
Note the leading white space.
c
Matches a sequence of width count characters (default 1); the next pointer must
be a pointer to char, and there must be enough room for all the characters (no
terminating NUL is added).  The usual skip of leading white space is sup-
pressed.  To skip white space first, use an explicit space in the format.

Similar Messages

  • How do I lock my default language to English for all web pages?

    I have discovered that my language keeps reverting back to French for my web pages. Not for the sites per se, but for anything that I manually enter into a field or form. And since I have my work and home computers set to sync, it keeps reverting back on both systems. It's not necessarily noticeable until I type a word that isn't in the French dictionary, and then everything gets the red underline to indicate the misspelling. I change it *every single day,* but it doesn't stick. Any suggestions?
    For the record... the language does not go to French on my Yahoo Mail, but it does on Facebook and random web pages. I initially thought it was a Facebook problem, but when I tried Chrome, MSIE, and Opera (yes, Opera), there was no French issue, I narrowed it down to Firefox. Sorry.

    You appear to have installed an additional French dictionary that shows as four French dictionaries in the right-click context menu under languages.
    This has nothing to do with installed languages in "Tools > Options > Content > Languages" that are language choices send to the server via the HTTP request headers.
    If you do not want to use those dictionaries then you can uninstall (or disable) the extension that added them.
    *French spelling dictionaries: https://addons.mozilla.org/firefox/addon/dictionnaires-fran%C3%A7ais/
    See:
    *https://support.mozilla.org/kb/Uninstalling+add-ons
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    If you do not keep changes after a restart or otherwise then see:
    *http://kb.mozillazine.org/Preferences_not_saved

  • Question for all programmers who use Xcode

    Hi,
    What style of indenting do you use?
    1)<pre>
    int myFunc(int num){
    //some code
    }</pre>
    2)<pre>
    int myFunc(int num)
    //some code
    }</pre>
    I uses style 2, but I cannot get Xcode 2.4 to properly indent nested braces. Here is an example:
    <pre>
    class Test
    public:
    Test()
    int x = 0;
    while(x < 10)
    { <font color="2200cc"><------- should be moved to the left</font></pre>
    Can anyone get that to indent properly in Xcode?

    So, for instance, the
    character sequence 'f' can be used to insert a for
    loop in your code. It's amazing how fast it is to
    write code with that feature.
    Textmate has that. Make sure you have the proper language selected at the bottom of the file window. If you have "C" selected, all you have to do is type "for", then hit the tab key and you'll get a "for" loop. And you can even tab from bit to bit to fill in the parameters you want. I've poked around with adding my own completions, too. It's a little non-obvious to me, but it might not be to someone else.
    Also, Xcode has something similar, just look at "Insert Text Macro" in the "Edit" menu. You can assign key bindings to any of those. So, for example, I bound "option"-"f" to the "for" loop. If you haven't already discovered it, there's an easy way to move from parameter to parameter, just use the "control"-"/" key combo.
    Also, just tonight, I discovered the free Completion Dictionary plugin. It's really easy to define your own text macros. One thing I found puzzling was the key binding to expand the macro. Completion Dictionary comes with a key bindings file, but I couldn't make it work, so I just added a key binding to the "Expand Macro" submenu. Works a charm.
    Finally, as to your original question, about the indenting. Did you want the "{" to line up directly below the "while"? If so, Textmate does that for me:
    <pre class="command">class Test
    public:
    Test()
    int x=0;
    while (x<10)
    // something.
    }</pre>But that's a language I never use (Java or C++?), so I'm not real sure about that.
    Finally, I should put in a word for BBEdit. It's what I actually use most of the time for work, since I work on a web site all day long and I've been using it forever. It has a slick feature where you can build various kinds of macros using Perl or other scripting languages, which is great for creating really complex (or tedious) bits of code. But it doesn't have the same kind of autocompletion as Textmate or Xcode does.
    charlie

  • Execute Webdynpro4Abap Application with same ERP-User for all portal-users?

    Hi,
    is it possible to let a Webdynpro4Abap application run with only one ERP-User for all portal-users? Therefore not needing an ERP-license for every portal-user?
    Somekind of mapping maybe?
    Regards
    Jan

    Jan,
    It is possible but it all depends on the type of application .If you want to show same data for all users you can use one user but if data is different for all users then you cannot go with this approach.
    to configure single backend user for your application go to tcode SICF and look for that application and go to logon data tab by double clicking and give one common user details
    Thanks
    Bala Duvvuri

  • Is there any way to set global language as english for users  in portal

    Hi,
    Is there any way to set global language as english for all the users  in portal (for all the screens,applications etc) irrespective of browser settings,language in jco,user settings in backend .
    the reason why i am asking is we are implementing global implementation project and for some users in switzerland because of their browser is not english they are getting language other than english.we dont want to ask each user to change their browser language.we just want to force the portal to display content only in english
    Thanks
    Bala Duvvuri

    Hi ,
    You can add property  'request.mandatorylanguage=<your_language>'
    and property  'request.mandatorycountry'
    on file 'prtDefault.properties' located in :
    ..server0\apps\sap.com\irj\servlet_jsp\irj\root\WEB-INF\portal\system\properties\prtDefault.properties
    Then restart the server.
    See :
    http://help.sap.com/saphelp_nw70/helpdata/EN/42/938297a5061d69e10000000a1553f6/frameset.htm
    Regards,
    Gilad

  • Installing the SDK from .dmg

    Hello. I was wondering if the old SDKs get uninstalled or overwritten when we install the new SDKs? The only reason I ask is because I had the 3.0 SDK, then upgraded to 3.1 which said it would take like 4 GB or something about a wk ago, and then upgraded to 3.1.2 which said it would take another 4 or 6 GB and it seems odd to take up that much space unless the old ones are not getting overwritten. Thoughts? Thanks!

    jwfc wrote:
    after installing the 3.1 SDK, and then the 3.1.2 SDK, I saw they used 10GB of space.
    Yeah, I didn't pay enough attention to those version nos. in your original post. Was 3.1.2 a release when you downloaded it? Dunno if the install policy is different for a subversion. Your disk usage seems a little low for all 3 SDK's, so can we assume the 3.1 install overwrote 3.0?
    Is there a way to manually uninstall the SDKs on the MAC and just reinstall the newest version of the SDK.
    The uninstall directions are toward the end of the readme that came with 3.1. If you threw away the dmg, you should still have a copy in /Developer/"About Xcode Tools.pdf". I think it's also online at the Dev Center, but if you can't find it anywhere, let us know and I'll paste it here for you.
    \- Ray

  • Detecting ALL jre/sdk home path

    Hi i know i can use the getProperties function to detect the path of the actual jre but i want a way to do this to have the path for all jre/sdk installed on the user pc.. how can i do this?
    thx

    someone answer me on another forum
    i acces the regedit, so it's a windows solution for now...
    thx
    i'm leaving this topic

  • Define the language for all notifications to language receiver

    Hi,
    In our workflow after the manager has done an action, a notification is send to the employee.
    The problem is that the text of the notification is always created in the language of the initiator. With us the language of the initiator can be different from the receiver.
    I would like to define that for all notifications always the language of the receiver is to be taken and not this from the initiator.
    Does anybode knwos how we can do this ?
    Kind regards
    Pascale Thys
    Dexia Bank Belgium

    (A) Reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    (B) Swipe upwards from bottom of screen to launch Control Center. Make sure sound is not muted (tap the little bell)

  • HT204053 Is it possible to have two (or more) different icloud mail accounts (not alias) under the same apple id? If not what is you best advice for all family members to have their own e-mail and still share the purchases under the same apple id. Thanks

    Is it possible to have two (or more) different icloud mail accounts (not alias) under the same apple id? If not what is you best advice for all family members to have their own e-mail and still share the purchases under the same apple id. Thanks

    mannyace wrote:
    Thanks for the response.
    So I basically won't run into any trouble? I
    There should be no issues. Its designed to work like that.  You don't change Apple IDs just because you get a new device.
    mannyace wrote:
    Thanks for the response.
    Is there any chance that the phones can fall out of sync?
    Unlikely. But nothing is impossible.   Though I don;t see how that would happen. As long as both are signed into the Same Apple ID / iCloud Account they will be N'Sync. (Bad Joke)
    mannyace wrote:
    Thanks for the response.
    If I get a message or buy an app or take a photo on the iPhone 5, how do I get those things onto the iPhone 6?
    If you buy an App, you have 2 ways to get it to the iPhone6: If Automatic Downloads is enabled in Settings->iTunes & App Store, it will automatically download to the iPhone 6 when you buy it on the 5 and vice versa if you buy it on the 6, it will download to the 5.
    Alternatively, you can simply go to the App Store App->Updates->Purchased and look for the App there and download it. Purchased Apps will not require payment again. i.e They'll be free to download to the iPhone 6 once purchased.
    SMS Messages will sync over using Continuity as long as they are on the same Wifi network. Otherwise, restoring the iPhone 5 backup to the iPhone 6 will transfer all messages received up until the backup was made onto the iPhone 6.
    Images, can be transferred either through Photo Stream
    My Photo Stream FAQ - Apple Support
    Or any Cloud service you want such as Dropbox, or One Drive.
    mannyace wrote:
    Also, something i forgot to ask initially: Should I update the iPhone 5 to iOS 8 first or does that not matter?
    If you want the Continuity features as explained above you need to update the iPhone 5 to iOS 8. Otherwise its not all that important.

  • HT204053 I have different icloud and iTunes id's and I want to do homesharing for all my devices. I'm trying to set up a new iMac but homesharing is not working. SHould it be the itunes or iCloud id?

    I have different icloud and iTunes id's and I want to do homesharing for all my devices. I'm trying to set up a new iMac but homesharing is not working. Should it be the itunes or iCloud id?

    Welcome to the Apple Community.
    Preferably your iTunes account, but it shouldn't really matter for getting homesharing turned on, as long as it's a valid ID.

  • What is the best practice for localization?One .rpt for all/each language?

    Hi All,
    I have a question :
    What is the best practice for localization?One .rpt for all language or one for each language? I
    Thanks for your response,
    jz

    Well, speaking of best practices, see the [Rules of Engagement|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement]
    Step 2 Asking Your Question; Provide Enough Information
    Next, make sure you search these forums before posting. Your question may just be already answered, thus giving you quicker resolution. For example, these threads come up just searching for "localization":
    Multiple language support
    Crystal Reports localization issue
    English resource files
    Next, (assuming you are working with CR 2008), see the developer help files:
    http://help.sap.com/businessobject/product_guides/boexir31/en/crsdk_net_dg_12_en.chm
    http://help.sap.com/businessobject/product_guides/boexir31/en/crsdk_net_apiRef_12_en.chm
    https://www.sdn.sap.com/irj/boc/sdklibrary
    In the Crystal Reports 2008 .NET SDK developer Help file, search for "Localization".
    Ludek

  • What is the best practice for localization? One .rpt for all language

    Hi all,
    I have a question: what is the best practice for localization? One .rpt for all language or one .rpt for each language?
    Thanks for any response,
    Jz

    What would be best would depend on workflow.
    Sincerely,
    Ted Ueda

  • Changing the default keyboard language for all users via command line

    I have about 250 computers, that I set the wrong default language on.
    I am hoping someone here can help me. I have 3 keyboard languages installed in my labs,
    En-English (United States)
    Fr-French (Canada)
    En-English (Canada)
    I'd like to make the Fr-French (Canada) the default keyboard language for all users that login I have tried the following xml but it's not working. I do not see the problem any help would be appreciated.
    I tried to run it by doing this
    control intl.cpl,, /f:"FR-DefaultKeyboard.xml"
    The following code below is called FR-DefaultKeyboard.xml file.
    <gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend">
    <!--User List-->
    <gs:UserList>
    <gs:User UserID="Current"/>
    </gs:UserList>
    <!--User Locale-->
    <gs:UserLocale>
    <gs:Locale Name="FR-CA" SetAsCurrent="true"/>
    </gs:UserLocale>
    </gs:GlobalizationServices>

    <gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend">
    <gs:UserList>
    <gs:User UserID="Current" CopySettingsToDefaultUserAcct="true" CopySettingsToSystemAcct="true"/>
    </gs:UserList>
    <gs:InputPreferences>
    <!--English US EN-->
    <gs:InputLanguageID Action="add" ID="0409:00000409" Default="false"/>
    <!--French CA CA FR-->
    <gs:InputLanguageID Action="add" ID="0c0c:00000c0c" Default="true"/>
    <!--English CA EN-->
    <gs:InputLanguageID Action="add" ID="1009:00001009" Default="false"/>
    </gs:InputPreferences>
    </gs:GlobalizationServices>
    This worked, thank you

  • HT4341 I will be traveling to The Netherlands, Germany and Luxembourg in May. I want to take my MacBook Pro, 1st generation iPad and iPhone 4G. Is there one charger that I can take for all devices, as opposed to taking three different chargers?

    I live in the US, and I will be traveling to The Netherlands, Germany and Luxembourg in May. I will be taking my MacBook Pro, 1st generation iPad and iPhone 4G. Is there a universal charger that I can use with all three devices, as opposed to taking three seperate chargers?

    I obviously have three different chargers, I guess my question is, can I use just one of those chargers for all three devices, and if so, which one of the three, or does it matter? And if I can in fact use just one of the three, then why would I need all three in the US? Also, if one of the three will work on all devices, would the automotive charger work the same, one for all? Thank you for your reply.

  • I have two iPads. With two functioning iPads. Is it possible (on the same ID) to sync two of them differently with the same account. So I want to use the new iPad for all my current functions. The old iPad for just my music collection?

    I have two iPads. With two functioning iPads. Is it possible (on the same ID) to sync two of them differently with the same account. So I want to use the new iPad for all my current functions. The old iPad for just my music collection and remove all the other stuff?

    Very easily. I have an iPod touch and iPad on the same account with totally different content.
    If you use iTunes, connect each iPad to your computer and open iTunes and deselect any automatic updating/syncing. If you don't sync with iTunes but have them set up independently, under the settings, App Store, turn off automatic downloads for apps, etc.
    I'm old fashioned, I set up and sync my iPad and iPod to my computer and iTunes. Each device has a different name  and I manage content manually and only allow sharing on what I want shared.

Maybe you are looking for

  • Crash upon opening Adobe Media Encoder

    Hello, I just built a new computer and installed Adobe CS3 Production Premium, with all the updates (Premiere Pro 3.2). I'm editing a project with DVCPRO HD 720p clips. When I try to open the Adobe Media Encoder, Premiere freezes, and I'm forced to r

  • Problem with Essentials.xml in CS6

    I have been working on a project for weeks and now it won't load because Flash CS6 gives me this error: "The following panel or layout is missing or could not be read".  Which is Essentials.xml.  The file is in the directory but it is now blank.  I h

  • I cannot use fax on my Pavilion 20

    I connect to the internet using a t mobile stick.  My phone line is not involved.  Can this be the problem?  Every fax fails.  

  • 1-second glitches in compressor output

    Hello, I have been scanning this forum, which is chock-full of compressor gripes. I can't tell for sure, but don't see my particular problem here. I have footage (all 60i) which, when encoded (1pass VBR) generally looks ok - but there are sections, i

  • Can't see shared folders with smbnetfs

    Hi! I'm having trouble with smbnetfs. i installed it successfully, but the folder where the shares should be mounted is always empty I can mount folders with smbmount and there are no problems but i would like to be able to see all the shared folders