- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 9
- Posts with Upvotes
- 9
- Upvoting Members
- 9
- Downvotes Received
- 9
- Posts with Downvotes
- 8
- Downvoting Members
- 7
111 Posted Topics
![]() | Re: Why don't you it read directly from the file or read the output as an argument for the python script? Is it a multi line string? |
Re: To be honest I am very surprised that, this code cannot be saved to your arduino board. But to optimize it, can you state how many columns of LEDS you have and how many rows. Based on that I think it is possible to optimize your code. You might also … | |
Re: [code] #include<stdio.h> void main (void) { char x; printf("\nEnter a Character : "); x = getchar(); printf("\nThe ASCII for Char is: %d",x); } [/code] This will work , if you need values in Hex then use of "%x" is always there. : ) | |
Re: I would suggest having a VPS. Because you can manage alot more with VPS rather than hosting. Hosting is expensive, whereas if you have VPS you can host several websites along with mail server. If you are good in networking, the advantages are countless. If you dont want to go … | |
Re: This code might help you get started. But try writing the code yourself. #include <iostream> using namespace std; int main() { int responses[] = {1, 2, 6, 4, 8, 5, 9, 7, 8, 10, 1, 6, 3, 8, 6, 10,3, 8, 2, 7, 6, 5, 7, 6, 8, 6, 7, … | |
Re: You would have to describe this in your manifest file that your application requires administrative rights. http://msdn.microsoft.com/en-us/library/bb756929.aspx Let us know if you want more info. | |
Re: I would suggest download Windows 8 Preview edition. It is legal and license is valid until April next year. Plus upgrading to Windows 8 will be very cheap. I heard it is around 40 dollars. But "normally" you cant get windows 7 for free. | |
Re: #include <iostream> using namespace std; int main() { int mult[11][12]; int i,j; // mult[10][X] * mult[X][12] = ans; for(i=0;i<10;i++) { mult[i][0] = i+1; } for(j=0;j<12;j++) { mult[10][j]=j+1; } for(j=0;j<12;j++) { for(i=0;i<10;i++) { cout<<"\n"<<mult[10][j]<<" x "<<mult[i][0]<<" = "<<mult[10][j]*mult[i][0]; } } } return 0; } | |
Re: [code] #include <iostream> #include <string.h> using namespace std; class Functions { public: Functions() { char str[100]; cout<<"Enter the String:"; cin.getline(str,sizeof(str)); char newstr[100]={NULL}; for (int i=0,j=0;i<strlen(str);i++) { if(str[i] == ' ') { } else { newstr[j] = str[i]; j++; } } cout<<"New String:"<<newstr<<endl; } }; int main() { Functions(); return 0; … | |
Re: Hi, This might help you to change, background and foreground colors of the console. [link] [url]http://www.javaworld.com/javaworld/javaqa/2002-12/02-qa-1220-console.html[/url] [/link] | |
Re: [code] #include <stdlib.h> #include <iostream> #include <time.h> using namespace std; int main() { int x[4]; int _key; srand ( time(NULL) ); for(int i=0;i<4;i++) { x[i] = rand(); } cout<<"The key is:"<<x[3]<<"-"<<x[2]<<"-"<<x[1]<<"-"<<x[0]<<endl; return 0; } [/code] if you want to customize it to characters you can. | |
Re: If the user enters the single character I don't see a reason why you can't use: [code] char c; c = getchar(); [/code] But it all depends on the requirement of the software. | |
Re: [code] #include <iostream> #include <string> using namespace std; string convertToPig(string); int main() { //get user input string word; cout << "Enter word to be translated\n"; cin >> word; cout << "you entered: " << word <<"\n" <<"the translation is: "; cout << convertToPig(word); return 0; } string convertToPig(string arbitrary) { … | |
Re: You are printing only first character of the array that is why you are only getting 1. Because buff[0] = '1' , buff[1] = '2' and buff[3] ='3' If you want "123" in one element of an array. Then has to be a string array or a multidimensional character array. … | |
Re: [code] #include <iostream> using namespace std; int main() { double CAL,MET,MINS,WEI; CAL = MET = MINS = WEI = 0; cout<<"Enter you weight in pounds:"; cin>>WEI; cout<<"Enter MET number:"; cin>>MET; cout<<"Enter the duration in mins:"; cin>>MINS; CAL = 0.0175 * MET * WEI/2.2; CAL = CAL * MINS; cout<<"Total Calories:"<<CAL<<endl; … | |
Re: Hi, If you want to achieve this without using special libraries.The way I think it should be done is by, converting the pgm files into normal text files. You should be aware of the format of pgm files. The new text file will be all the pixels of the image. … | |
Re: Hi, Here is the code for string extraction. As you didn't mention anything about delimiters so I dont know whether you have to use that in the code or not. This code is a version with for loops and if statements. [code] #include <stdio.h> #include <string.h> #include <iostream> using namespace … | |
Re: [code] #include<stdio.h> int main() { int i,j,temp; printf("\nEnter the Number :"); scanf("%d",&temp); switch(temp) { case 1: for(i=0;i<5;i++) { for(j=0;j<=i;j++) { printf("*"); } printf("\n"); } break; case 2: for(i=5;i>0;i--) { for(j=0;j<=i;j++) { printf("*"); } printf("\n"); } break; case 3: for(i=5;i>0;i--) { for(j=0;j<=i;j++) { printf("*"); } printf("\n"); } break; case 4: for(i=0;i<5;i++) … | |
Re: [code] #include<stdio.h> #include<stdlib.h> #include<math.h> /* -------------------------------------------------------- */ /* Main program for algorithm 5.2 */ /* remember : in C the fields begin with element 0 */ #define DMAX 15 /* Maximum degree of polynomial */ #define NMAX 20 /* Maximum number of points */ int main(void) { extern void FactPiv(); … | |
Re: I would say dont use a char array to read data from serial port. Use it as int array, and convert the data you get in hex. I am sure you will find this helpful. I am saying this from experience. I have done serial interfacing using C enough times. … | |
Re: Don't download Netbeans only for GUI. To be honest, in some of the professional companies I have been to, majority of them use Eclipse, because i think it is quite portable, I might be wrong. But Netbeans is very impressive, easy to use, however I had some problems in GUI … | |
Re: [code] import java.io.*; import java.util.Scanner; public class Main { public static void main(String[] args) { Process(5); } public static void Process(int number) { try{ FileReader file1 = new FileReader("input.txt"); BufferedReader f = new BufferedReader(file1); String temp; int i =0 ; while((temp=f.readLine())!=null) { i++; if(i==5) { System.out.println(temp); } } } catch(Exception … | |
Re: [code] #include <fstream> #include <iomanip> #include <cmath> #include <iostream> using namespace std; int main() { char fare; char choice='Y'; int hrIn, minIn, hrOut, minOut; int hours; int minutes; int total_minutes; double cost; float charge; float additionalTime; while(choice=='Y'||choice=='y') { cout << "\nThis program will calculate a single, couple, or group " … | |
Re: Ohhh that is some code:). You could have used the AI algorithm given for Tic Tac Toe game. But i dont think you will have a problem with gui. Ofcourse your GUI class will be really different from this code, but if you are allowed to use netbean IDE then … | |
Re: yep , [code] private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { if(jRadioButton1.isSelected()) { // do the operation } else { //do nothing } } [/code] | |
Re: I wrote this code solely for my own programming practice. Ofcourse you can use it for making keyloggers and typing tutors. But I would advise you to use it in a good way. [code] #include <iostream> #include <stdio.h> #include <conio.h> #include <Windows.h> using namespace std; FILE *f1; int main() { … | |
Re: Programming is Programming and some say "C++ is better C", so posting this in C is not a big issue. I think the problem is related to size of arrays. Is it possible if you can give the text file containing the data? By the way 2000 was a leap … | |
Re: Are you sure there is no problem with your code? What do you want to do? | |
Re: I need more description.. Is this code a part of an electronic project? | |
Re: I am pretty sure that 64 bit processors are faster than 32 bit. | |
![]() | Re: Hi, Just to get you started, have a look at this, i coded this in 10 mins so it is not complete at all but if you think for few mins, you can create maze using it. Run this program and you will see what I am trying to say … ![]() |
Re: According to your code, it is more like VHDL style for implementing C++. You will not be able to solve this problem if you don't use the right syntax. Let me tell you, problem is really easy, for a normal programmer it can be done in 2-5 mins. But it … | |
Re: Yes George is right.. I wrote this sample code for you. The formula might not be correct and it is missing functions, plus you have to change the variable types if you want to.... Now run this program, you will understand what you have to do. [code] #include <iostream> #include … | |
Re: You can check the efficiency of your program by checking its execution time.I am very sure there are some Run time checks you can do online for your program. Secondly the program is well structured, but only one class??? Having more Classes and internal Classes will certainly make your code … | |
Re: Error is gone, but check whether it is working the way you want [code] #include <iostream> #include <iomanip> #include <string> using namespace std; void centerLine(const string &text, unsigned int lineLength); void printDoubleHorizontalLine(unsigned int lineLength); int main() { centerLine("hi",10); printDoubleHorizontalLine(10); return 0; } void centerLine(const string &text, unsigned int lineLength) // … | |
Re: Hi, How about using char far *s2? Using char far will allocate 4 bytes of memory for your pointer(in simple words) which is double the size of the ordinary char pointer. | |
Re: [code] #region using directives using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Drawing; using System.Drawing.Imaging; using System.Drawing.Drawing2D; using System.Management; using System.Resources; using System.Media; using System.Globalization; using System.Windows.Forms; using System.IO; #endregion namespace practice { class Program { static void Main() { Program.html_scanner(); } static void html_scanner() { string var,filename,var_mod,text; int … | |
Hi, I have been working on this small console applications for 2-3 days now but I cannot find the problem. The Task is that I have to read a file which has sentences in english and I just have to get the frequency for each character and print it out … | |
Re: Hi, you can install microsoft visual C++ or C# and use windows forms. You have to write minimal of the code as designing the GUI is drag and drop process. Or if you prefer JAVA then use netbeans IDE which also allows you to make GUI using Drag and Drop … | |
Re: i have to say that you guys have missed a big problem with this code. Or the compilers you guys are using are not good enough to compile your programs. look at this : [code] double values[20][1]; for( r=0; r<20; ++r ) { // this will count from 0 to … | |
Re: [code] #include<iostream> #include<cmath> using namespace std; int main() { double EqR,a,b,c,delta; EqR=a=b=c=delta=0; cout<<"\nEnter the Value for a:"; cin>>a; cout<<"\nEnter the Value for b:"; cin>>b; cout<<"\nEnter the Value for c:"; cin>>c; if(a==0 && b==0 && c==0) { cout<<"\nThe equation has an infinity solution"; } else if(a==0&& b!=0 && c!=0) { double … | |
Re: Funny people come here, he hasn't done the work and he is still showing arrogance.. Why don't they understand that when they will work for someone in future, people come to them to ask about these things. So they should try to learn rather than finding back doors for temporary … | |
Re: Try to use this if it helps... [code] #include <iostream> #include <string> #include <time.h> using namespace std; int main() { char T[9]; _strtime_s(T); cout<<T; return (0); } [/code] But your problem is still there... You can solve it by using an iteration algorithm using "goto" OR you can use timers, … | |
Re: What is your Question? If you want the program to start again then you need a while loop with a terminating character. [code] #include <iostream> #include <string> using namespace std; int main() { int Guess_Val = 0,Rand_Val = 0, Counter = 10; bool Condition=false; Rand_Val = rand() % 100 + … | |
Re: I have an idea, how about if your job id is JOB_?_001, and you create a folder named as JOB_63_001&? What I am trying to say here is whenever the illegal character appears in the job_id just replace it with its ascii. You will have to rearrange the whole character … | |
Re: First of all you didn't show any work, the rule is that "you show the work and we help you with it" it would be nice if you give it a go, and lets see where you get stuck. | |
Re: The method I will use to acheive this is, by making a batch file. You can create a batch file from your program, the only difference is it ends with a ".bat", rest it is just a text file which contains the commands you want to enter in DOS. And … | |
Re: Hi, As I am learning about linked lists and nodes. I found this link very useful. Link: [url]http://richardbowles.tripod.com/cpp/linklist/linklist.htm[/url] | |
Re: Hi, I have studied DSP and FFT in detail. But I am afraid it cannot help you in programming. FFT is further derivation of Fourier series. Because the problem with fourier series is that you cannot use it for aperiodic signals. But FFT can be used for aperiodic signals, because … | |
Re: I don't understand the problem. Is it possible if you can provide detail about the problem.Are you talking about windows forms? |
The End.