[Solved] C# I/O vs C I/O

[ad_1] There is probably not a significant performance gain in using a C/C++ dll. The C# runs in an environment with a quite efficient JIT compiler, so my guess is that the code performance is limited by a hard disk read speed of approximately 100 MB/s. Of course, if you have an SSD, your mileage … Read more

[Solved] Can’t Find Seg Fault in C Code

[ad_1] Valgrind and GDB are very useful. The most previous one that I used was GDB- I like it because it showed me the exact line number that the Segmentation Fault was on. Here are some resources that can guide you on using GDB: GDB Tutorial 1 GDB Tutorial 2 If you still cannot figure … Read more

[Solved] opening Internet Explorer using c programming language

[ad_1] I guess you have specified the path to Internet Explorer like this “C:\Program Files\Internet Explorer\iexplore.exe” But because the \ character is an “escape” character in a literal string, you need to defeat the escape “C:\\Program Files\\Internet Explorer\\iexplore.exe” There was no error when you compiled because the compiler cannot check whether the command passed to … Read more

[Solved] Letter combinations of a phone number

[ad_1] The problem is that you’re both looping and recursing. print(“22”, “”, 0); will recurse into print(“22”, “a”, 1); print(“22”, “b”, 1); print(“22”, “c”, 1); print(“22”, “a”, 2); print(“22”, “b”, 2); print(“22”, “c”, 2); and your extra bits are the last three calls. Get rid of the loop over the input digits (you’re already doing … Read more

[Solved] Animation like Siri when you speak [closed]

[ad_1] Obviously there is a way to achieve this – but is it worth the effort? What you would need: A audio input stream. An spectrum analyzer (something like what this does: http://www.qsl.net/dl4yhf/spectra1.html – there are more than enough signal-processing papers out there). An digestive format to display it. A new view (depending on the … Read more

[Solved] I’m just beginning to learn C: Can someone explain what the pointers and typecasting are doing in this code? [closed]

[ad_1] The snippet char *encrypt(char *string, size_t length) { } defines a function named encrypt, which takes a char * and a size_t as arguments, and returns a char *. As written, the function body is empty and will trigger at least one diagnostic because it isn’t returning a value. It looks like it’s meant … Read more

[Solved] Program doesn’t continue loop [closed]

[ad_1] Just add one line of code after the cout statement as follow: if (mode == TOPIG) { cout << “TOPIG MODE” << endl; while (cin.good()){ getline(cin, lines); while (!looking) { spot = lines.find(” “); if (spot == -1){ looking = true; spot = lines.length( ); } line = lines.substr(0, spot); TP1stLetter(line); if (!looking) lines … Read more

[Solved] C programming do while with switch case program

[ad_1] Use a do…while loop like this: int I = 1; //Initialize to some non-zero number to prevent UB printf(“Enter 0 to quit \n”); do{ if (scanf(“%d”,&I) != 1) //If invalid data such as characters are inputted { scanf(“%*[^\n]”); scanf(“%*c”); //Clear the stdin } } while(I!=0); //Loop until `I` is not 0 This piece of … Read more

[Solved] Using combo box in c# [closed]

[ad_1] Well, i ll try to give you a quick example in Windows Forms. Like you said, you got 2 combo boxes Category and Brand, i named cmbParent and cmbChild. I declared some variables: List<String> listParent = new List<String>(); List<Tuple<String, String>> listChild = new List<Tuple<String,String>>(); On Form_Load, i did some manual lists: public ComboForm() { … Read more

[Solved] After adding braces,file output not proper [closed]

[ad_1] You probably want this: for (l=0; l<ny; l++) { if (xflg) index = m * nxy + l*nx + k; else index = m * nxy + k*ny + l; vel[index] = velocity; fprintf(f,”%5d\n”,index); //<<< line added /* fprintf(stdout,”%.1f %.1f %.1f “, this_z, this_x, velocity); */ } or maybe this: for (l=0; l<ny; l++) … Read more

[Solved] How to find all words in a string C# [closed]

[ad_1] You will have to do it in a loop, like this: public static string getBetween(string strSource, string strStart, string strEnd) { int Start = 0, End = 0; StringBuilder stb = new StringBuilder(); while (strSource.IndexOf(strStart, Start) > 0 && strSource.IndexOf(strEnd, Start + 1) > 0) { Start = strSource.IndexOf(strStart, Start) + strStart.Length; End = … Read more