C programing SOS Help Me?
539824
this is a little more than Y answers can handle...you're better off looking at a tutorial online and using your book....good luck...you'll get it. C is not that hard to learn
108454
#include "ALLOC.H"\n#include "DOS.H"\n#include "CONIO.H"\n#include "STDIO.H"\n\n\nvoid main()\n{\n char *name;\n printf(" Enter the file name...:");\n scanf("%s",name);\nplaywav(name,1.0);\n\n}\n\n\nvoid playwav(char wavefile[14],float delaytime);\nstruct WaveData {\n  unsigned int SoundLength, Frequency;\n  char *Sample;\n};\n\n\nstruct HeaderType {\n  long         RIFF;      //RIFF header\n  char         NI1 [18];  //not important\n\n  unsigned int Channels;  //channels 1 = mono; 2 = stereo\n  long         Frequency; //sample frequency\n  char         NI2 [6];   //not important\n  char         BitRes;    //bit resolution 8/16 bit\n  char         NI3 [12];  //not important\n} Header;\n\n\n\n\n\nstruct WaveData Voice;         //Pointer to wave file\n\n\nunsigned int    Base;          //Sound Blaster base address\n\n\nchar            WaveFile [25]; //File name for the wave file to be played\n\n\n/*************************************************************************\n***\n** Checks to see if a Sound Blaster exists at a given address, returns\n**\n** true if Sound Blaster found, false if not.\n**\n**************************************************************************\n**/\nint ResetDSP(unsigned int Test)\n{\n  //Reset the DSP\n  outportb (Test + 0x6, 1);\n  delay(10);\n  outportb (Test + 0x6, 0);\n  delay(10);\n  //Check if (reset was succesfull\n  if ((inportb(Test + 0xE) & 0x80 == 0x80) && (inportb(Test + 0xA) ==\n0xAA))\n  {\n    //DSP was found\n    Base = Test;\n    return (1);\n  }\n  else\n    //No DSP was found\n    return (0);\n}\n\n\n/*************************************************************************\n***\n** Send a byte to the DSP (Digital Signal Processor) on the Sound Blaster\n**\n**************************************************************************\n**/\nvoid WriteDSP(unsigned char Value)\n{\n  //Wait for the DSP to be ready to accept data\n  while ((inportb(Base + 0xC) & 0x80) == 0x80);\n  //Send byte\n\n  outportb (Base + 0xC, Value);\n}\n\n\n/*************************************************************************\n***\n** Plays a part of the memory\n**\n**************************************************************************\n**/\nvoid PlayBack (struct WaveData *Wave)\n{\n  long          LinearAddress;\n  unsigned int  Page, OffSet;\n  unsigned char TimeConstant;\n\n\n  TimeConstant = (65536 - (256000000 / Wave->Frequency)) >> 8;\n  WriteDSP(0x40);                  //DSP-command 40h - Set sample frequency\n  WriteDSP(TimeConstant);          //Write time constant\n\n\n  //Convert pointer to linear address\n  LinearAddress = FP_SEG (Wave->Sample);\n  LinearAddress = (LinearAddress << 4) + FP_OFF (Wave->Sample);\n  Page = LinearAddress >> 16;      //Calculate page\n  OffSet = LinearAddress & 0xFFFF; //Calculate offset in the page\n  /*\n      Note - this procedure only works with DMA channel 1\n  */\n  outportb (0x0A, 5);              //Mask DMA channel 1\n  outportb (0x0C, 0);              //Clear byte pointer\n  outportb (0x0B, 0x49);           //Set mode\n  /*\n      The mode consists of the following:\n      0x49 = binary 01 00 10 01\n                    |  |  |  |\n                    |  |  |  +- DMA channel 01\n                    |  |  +---- Read operation (the DSP reads from memory)\n                    |  +------- Single cycle mode\n                    +---------- Block mode\n  */\n\n\n  outportb (0x02, OffSet & 0x100); //Write the offset to the DMA controller\n  outportb (0x02, OffSet >> 8);\n\n\n  outportb (0x83, Page);           //Write the page to the DMA controller\n\n\n  outportb (0x03, Wave->SoundLength & 0x100);\n  outportb (0x03, Wave->SoundLength >> 8);\n\n\n  outportb (0x0A, 1);              //Unmask DMA channel\n\n\n\n  WriteDSP(0x14);                  // DSP-command 14h - Single cycle playback\n  WriteDSP(Wave->SoundLength & 0xFF);\n  WriteDSP(Wave->SoundLength
588997
I use "C++ How to Program" by Deitel & Deitel.\nIt's really good
1130146
C program? Do you mean the C language, or the C Drive?
577652
Since you specified that the language is "C", it's\nworth pointing out that the Ansi standard guarantees\nthat the implementation will include a "qsort" function.\n\nAll you need to do is write the simple comparison\nfunction which is passed to qsort, and you're done.\n\nI copied the following (including the little test program)\ndirectly from the qsort man page:\n\n#include <stdlib.h>\n#include <stdio.h>\n\nstatic int\nintcompare(const void *p1, const void *p2)\n{\n  int i = *((int *)p1);\n  int j = *((int *)p2);\n\n  if (i > j)\n    return (1);\n  if (i < j)\n    return (-1);\n  return (0);\n}\n\nint\nmain()\n{\n  int i;\n  int a[10] = { 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };\n  size_t nelems = sizeof (a) / sizeof (int);\n\n  qsort((void *)a, nelems, sizeof (int), intcompare);\n\n  for (i = 0; i < nelems; i++)\n    (void) printf("%d ", a[i]);\n\n  (void) printf("&#92;n");\n  return (0);\n}\n\n\nSee the references for the man page as well as the\nsource from the OpenSolaris site.
207768
%SystemRoot%&#92;\nsystem32&#92;\ndfrg.msc\n\nDecompile for C/C++\n\n:-)
857429
Need2know Your big news here...\n:)! http://www.osoq.com/funstuff/extra/extra02.asp?strName=Need2know
920270
Here's a start.\n\nI see you are using 'getch()' from conio.h\n\nI assume this is to insert a pause into the program?\n\nThis is not an ideal bit of coding as it is no longer supported by all compilers. Do you know that your teacher wants you to use it? (I assume this is homework?)\n\nHere's some discussion about it if you're interested\nhttp://forums.devarticles.com/c-c-help-52/c-problems-with-getch-6229.html\n\nIf you make an attempt to write some code we may be able to help you more.\n\n\n# include<iostream>\nusing namespace std;\n\nint main()\n{\n   \n  getch();\n\n   return 0;\n}\n\nNOTE: Be careful about using the answers supplied below.\nmerven uses 'void main()' which is not standard c++.\nthe other example uses some C rather than C++ in places.\n\nAnd this is from smart people who know what they are talking about and are trying to help you. No disrespect of any kind intended from me towards them. Just that what they are coding may not meet your teacher's approval (depending on her/his preferences).\n\nAre you prepared to do any work at all to help yourself and therefore help us to help you?\n\n///
742648
#include<stdio.h>\n#include<conio.h>\nvoid main()\n{\nint n=5,i,j;\nclrscr();\nfor(i=1;i<=2*n-2;i++)\n{\nprintf(" ");\n}\nprintf("1&#92;n");\nfor(i=2;i<=n-1;i++)\n{\nfor(j = 1;j<=(n-i)*2;j++)\nprintf(" ");\nfor(j = i;j<=2*i-1;j++)\n{\nprintf("%d ",j);\n}\nfor(j = 2*i-2;j>=i;j--)\n{\nprintf("%d ",j);\n}\nprintf("&#92;n");\n}\nfor(i = n;i<=2*n-1;i++)\nprintf("%d ",i);\nfor(i = 2*n-2;i>=n;i--)\nprintf("%d ",i);\ngetch();\n}
814965
what c++ program are you referring to ...anyway the syntax is\n\n#include<iostream.h>\n#include<conio.h>\n...include all the header files here ..\n\nint count()\n  {\n     function body\n     return value #integer value to be returned \n\n  }\n\nother functions\n\nvoid main() \n\n   {\n\n# this is the main function \n\nint a,b,c;\nfloat al,bl;\nstring str;\n\n#declare the variables\n\n#get the inputs from the user\ncout<<"enter the value of a ";\ncin>>a;\n...\n...\n\ncall the functions\n\nb=count()\n..\n#do what ever processing has to be done\n } # program closing curly braces\n\n\nhope this helps\n\nthis is a excellent c++ tutorial \n\nhttp://www.geocities.com/sstutor\n\ncprogramming.com is also pretty good
602740
http://www.cprogramming.com
98474
you can use c compiler (cc)\ncc srcfile.c -o destfile
288377
PASCAL!!!its out dated, i think it is possible to get it on C/C++
790827
main () {char *s, b[100]; while(s=gets(b)) printf (atoi(s)%2 ? "nope&#92;n" : "yep&#92;n");}
943372
u have to ponit it or use\n\nthese are the 2 way's:\n\n#include <iostream>\nusing namespcae std;\nint main()\n{\nint num[8];\nint index;\n\nnum[0] = 42;\nnum[1] = 2001;\nnum[2] = 7;\nnum[3] = 180;\nnum[4] = 99;\nnum[5] = 1993;\n\nfor(index = 0; index <= 5; index++)\n{\nstd::cout<< index[num] << endl;\n}\n system("pause");\nreturn 0;\n}\n\nor\n\n#include <iostream>\n#define MAX 20\nusing namespcae std;\n\nint main()\n{\n\nint a[MAX] = {23,43,4,5,34,343,12,14};\nint b;\n\ncout.setf(ios::right);\n\nfor(b = 0; b < MAX; b++){\n\ncout << endl << endl;\n\ncout << "The Elemnt in ";\n\ncout.width(2);\n\ncout << (b +1) << " is ";\n\ncout.width(2);\n\nstd::cout << b[a];\n}\nreturn 0;\n}
1143912
There's no such site, as far as I'm aware.\nI don't think it's possible to convert from VB to C, because it would be too difficult (READ: impossible!) to do such a thing (they are too different programing languages, one is compiled, one interpreted...). You'd better try to understand the algorithm(s) in the programs and rewrite the code!
195373
Try this:\n\n#include <stdio.h>\n\nmain()\n{\nint size,array[50],n,m,border,max,buf,step;\nint i, j, temp;\n\nprintf("Input number of elements in array:");\nscanf("%d",&size);\n\nfor(n=0;n<size;n++) {\n  printf("input %d. element of array:",n+1);\n  scanf("%d",&array[n]);\n  }\n\n for (i=(size-1);i>=0; i--)\n  {\n   for(j=1;j<=i;j++)\n    {\n     if(array[j-1]>array[j])\n      {\n       temp=array[j-1];\n       array[j-1]=array[j];\n       array[j]=temp;\n      }\n     }\n   }\n\nfor(n=0;n<size;n++)\n   printf("%d. element: %d&#92;n",n+1,array[n]);\n\n}\n\n\n\nHERE IS MY OUTPUT:\n\nInput number of elements in array:8\ninput 1. element of array:6\ninput 2. element of array:2\ninput 3. element of array:3\ninput 4. element of array:5\ninput 5. element of array:1\ninput 6. element of array:4\ninput 7. element of array:5\ninput 8. element of array:7\n1. element: 1\n2. element: 2\n3. element: 3\n4. element: 4\n5. element: 5\n6. element: 5\n7. element: 6\n8. element: 7