This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <stdio.h> | |
| class L | |
| { | |
| private: | |
| int a1=1; | |
| public: | |
| L():a1(2), a2(a1) //Don't use like this, a2 result depends on compiler | |
| {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Mapper.CreateMap<DTOObject, MainObject>().ForMember( | |
| d => d.TopObject, | |
| mc => mc.MapFrom(s => new SubObject(){ | |
| SubPropText = s.TopText, | |
| SubPropFont = s.TopFont | |
| } | |
| )); | |
| //--> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Threading.Tasks; | |
| using System.Windows.Forms; | |
| namespace WindowsFormsApplication1 | |
| { | |
| static class Program | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <stdio.h> | |
| class L | |
| { | |
| private: | |
| int a1=1; | |
| public: | |
| L():a1(2), a2(a1) //Don't use like this, a2 result depends on compiler | |
| {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class AA | |
| { | |
| public: | |
| AA() | |
| { | |
| printf("1"); | |
| } | |
| virtual void F1() | |
| { | |
| printf("2"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <stdio.h> | |
| #define FOO_Def | |
| #define FOO_Def2 5 | |
| int main(int argc, const char * argv[]) | |
| { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <stdio.h> | |
| #define FOO_Def | |
| #define FOO_Def2 5 | |
| inline int foo1(int x) | |
| { | |
| return x*5+8; | |
| } | |
| #define macro(x) x* 5 + 8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| class AA | |
| { | |
| public: | |
| static int i; | |
| //static int i = 0; // compile error | |
| static const int KKKK= 10;//OKAY | |
| int k = 0; //warning, just allow after c++/11 to initialize value in class | |
| void fool(){printf("the value of i is %d\n", i);}//static function only can use "static const", can't use "static" variables |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private async void LoadImage_Click_1(object sender, RoutedEventArgs e) | |
| { | |
| StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Image/Tulips.jpg")); | |
| using (IRandomAccessStream fileStream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read)) | |
| { | |
| BitmapImage image = new BitmapImage(); | |
| image.SetSource(fileStream); | |
| Scenario4Image.Source = image; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <stdio.h> | |
| int main(int argc, const char * argv[]) | |
| { | |
| #define PRINTX(x) std::cout << #x << " = " <<x <<"\n" | |
| // ANSI C 比 K&R C 功能多了 # 及 ## ,這部份其實是 #2 的續篇 | |
| // 在 #2 中說到 ANSI 及 K&R 差異,現在再加上此部份,ANSI C 又 |