Skip to main content

Posts

Code to check your PC name

Set VObj = CreateObject("SAPI.SpVoice") with VObj Set .voice = .getvoices.item(0) .Volume = 100 .Rate = 1 end with Set VObj = CreateObject("SAPI.SpVoice") For Each Voice In VObj.getvoices I = I + 1 msgbox "I am " & Voice.GetDescription & " and ;)" Next For count=0 to 3 vobj.Speak"Cygig Lol, at least try to do it in a less obvious way" Next

how to Print starik triangle in c++

To Print starik triangle in c++ like this way ********** ********* ******** ******* ****** ***** **** *** ** * You can write following code in c++ editor. void main(){ const int size=10,x=0; for(int i=0;i<size;++i) { cout<<"\n"; for(int j=0;j<size-x;++j) cout<<"*"; for(int k=0;k<x;++k) cout<<" "; ++x; } getch(); }

How to use strcpy with malloc function

char s[]="Hello" is an array of chars char *s[] = "asa"; is an error coz itz an array of character pointers char *s[] = { "AAA", "BBB", "CCC"}; is OK --------------- char s[]="ABCD" char (*p)[5] = &s; //is fine... here p is a pointer to an array ------ In Your case... U cn do this char s[] = "Hello" char *p[2]; p[0] = (char *)malloc(sizeof(s)); strcpy(p[0], s); p[1] = (char *)malloc(sizeof(s)); strcpy(p[1], s);

Program for largest element in array using c++

Program for largest element in array using c++ int array[5],i,temp; printf("\n enter element in array"); for(i=0;i<5;i++) scanf("%d",&array); for(i=1;i<5;i++) { if(array[0]) { temp=array; array=array[0];array[0]=temp; } } printf("\n largest ele. in array=%d",temp); getch(); } we get array size 5 then enter 5 element in array..then tack temp variable before this we give separate 1st element in array to assign maximum element in array then compare it with one by one remaining element in array..if 1st ele in array is smaller than any one element in remaining array then print element in remaining array..else print 1st element in array. Deletes all array elements in c++ #include class Date { int mo, da, yr; public: Date() { std::cout << "Date constructor" << std::endl; } ~Date() { std::cout << "Date destructor" << std::endl;

Code to generate the pyramid structure using c++

Code to generate the pyramid structure using c++ main() { int i; int j,n,uppr,lowr, arry[] = {1,2,3,4,5,6,7,8,9}; /*Take Input */ do { cout << "Enter an odd number(0-9):"; cin >> n; if(n < 0 || n > 9 || ((n % 2) == 0)) cerr << "Error" << endl; }while(n < 0 || n > 9 || ((n % 2) == 0)); /*Generate the pyramid structure */ for(i = 0; i < n; i++) { for(j = 0; j < ((i < (n-i-1)?i:(n-i-1))); j++) cout << " "; lowr = (i < (n-i-1)) ? i : (n-i-1); uppr = (i < (n-i-1)) ? (n-i-1) : i; for( j = lowr; j <= uppr; j++) cout << arry[j]; cout << endl; } return 0; } To execute something before main function you can try below code fun() { clrscr(); printf("\nIn the fun.........."); } #pragma startup fun int main() { printf("\nIn the main()"); getch(); return 0; }

Difference between Visual C++ and Visual C++.NET

Difference between Visual C++ and Visual C++.NET VC++ is only the "single user system GUI" i.e the program or application written in VC++ are to be installed in each machine to use that. While VC++.NET is the "Networked or Web based gui" i.e The program or application written in VC++.NET need not be installed in each machine but it will be in the server and all other machines can use that application by "DOMAIN NAME" or "IP address .NET programmes are made available in the Internet or globally by making use of any servers i.e "Apache server" "Jboss server" "Web logic" all the .NET programme files are put in any of these servers and using IP address this programmes can be accessed. VC++ is a compiler for C/C++ and all and not a language in itself, but the WIN32 platform offers so much applications in itself that it is a almost new world. As far as my decision of going with VC++ 6.0 and VC++.NET is that the bo