C++ :: Standard Way Of Changing The Text And Colour
Oct 7, 2014
Earlier 4-5 years back, When I started learning C++ I used textcolor() function to change the textcolour. But its not working in Code Blocks 13.12. Is there any other standard way to color the text and background.
View 2 Replies
ADVERTISEMENT
Oct 7, 2014
Earlier 4-5 years back, When I started learning C++ I used textcolor(),delay() function to change the textcolour and delay the O/P respectively. But its not working in Code Blocks 13.12. Is there any other standard way to color and delay the text.
View 3 Replies
View Related
Jun 4, 2013
I was reading a c++ code written in embarcadero ide to add vertical colour text in popup menu.
While reading the code, I had seen following instructions.
private:
Code:
void __fastcall ExpandMenuItemWidth(TObject *Sender, TCanvas *ACanvas,int &Width, int &Height);
Code:
void __fastcall DrawNewItem(TObject *Sender, TCanvas *ACanvas, const TRect &ARect, bool Selected);
The above two methods used in the code like below:
Code:
PopupMenu1->Items->Items[i]->OnMeasureItem = ExpandMenuItemWidth;
PopupMenu1->Items->Items[i]->OnDrawItem = DrawNewItem;
What is happening when we are using member function without parameters like above?
I found above code at: [URL] ....
View 2 Replies
View Related
Jul 14, 2014
I learned the bitwise operations in c, but how to shuffle the bits of the plain text accoring to DES's standard. Even with the key and the S-boxes. How DES is performed in C step by step. I have a fair knowledge in C.
View 3 Replies
View Related
Jul 4, 2014
I would like to find out a way to set the text and window sixe for the window in c++. I am using code::blocks compiler
View 4 Replies
View Related
May 13, 2014
I try to change the text color of console in C++. I know some commands like .
system("color fg");
But I want to change the color of only one line of console. Is this possible?
View 4 Replies
View Related
Dec 28, 2014
I've recently started creating a bingo caller application. I need in changing numbers to different text boxes. When a number is called it will be displayed in a text box and the last four numbers previous to that. However the oldest number needs to delete and for the remening numbers to move when a new number is called.
View 2 Replies
View Related
Jan 16, 2014
May I know how to change a button colour using visual C++ ? Currently using visual studio 2010.
View 6 Replies
View Related
Oct 21, 2013
I've been trying to calculate the Second standard deviation but the average in the second loop isn't calculating correctly which is causing the standard deviation (method 2) to not calculate correctly. I can't find anything wrong.
Code:
#include <iostream>#include <iomanip>
#include <string>
#include <fstream>
#include <cmath>
usingnamespacestd;
int main ()
[Code]...
View 8 Replies
View Related
Jul 11, 2014
I have a program that will calculate max, average, etc from a file of numbers. However, I cannot get it to calculate standard deviation.
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <cmath>
[code]....
View 4 Replies
View Related
Feb 6, 2014
How to make a standard deck of cards and being able to shuffle and distribute the cards. I have made an array to store each card and I can display them but I assigned them all in order according to the suit and rank. Is this a viable way to do it if I intend to have a shuffle effect? Or should I create an array, randomly generate card, check for duplicates, then put them in the array, then display the array? Each card is a structure with two void pointer members for suit and rank.
View 1 Replies
View Related
Jul 18, 2013
Is there any code I can use to determine my compiler version and which Standard It uses? I know the following code determine that my compiler followed ANSI But how about a version of that? ****My OS is now Ubuntu
Code:
#include <stdio.h>
int main(void){
printf("File :%s
", __FILE__ );
printf("ANSI :%d
", __STDC__ ); //return 1 if it follow ANSI but version?
return 0;
}
View 3 Replies
View Related
Dec 22, 2013
Is there any way to do date math using standard C libraries? I looked around in the time.h but didn't see what I needed.
What I need to do is be able to add a certain number of minutes to a date and have it give the current date/time. For example, add 15918765 minutes to 01/01/1980 00:00 and have it tell me 04/07/2010 4:45PM. I really don't want to write this myself or go platform-specific.
Does this exist somewhere or am I SOL?
View 13 Replies
View Related
Mar 21, 2013
Here's my code, it's for a poker hand evaluator
input:
'ad 2d 3d 4d 5d...
...4s 5s 6s 7s 8s'
I think it should go through all the 10 crads and disply the name of each card, but it seems to only do it for the second hand
Code:
include <stdio.h>
#include <ctype.h>
int main( void ) {
char inputtedhand[64];
int z=0, counter=0;
int index;
int i=0,m=0,n=0;
[Code].....
View 3 Replies
View Related
Nov 14, 2013
I'm looking to translate say the standard code for 4 which is 52 to the integer 4 is that possible with a build in function i C?
View 5 Replies
View Related
Oct 30, 2013
so i'm using scanf() this way
Code:
int i;
while (scanf("%i", &i))
printf("%i ", i);
printf("
done
");
i tried several combination of Ctrl+D and "Enter", it's not terminating, Ctrl+C just "cancels" the whole thing without printing "done", i'm running this on linux installed on a PC
View 9 Replies
View Related
Oct 23, 2013
The main point of the program is to calculate equations just like a standard calculator but I wanted to do it myself. I don't understand what the problem is right now but I've managed to create a program that asks for both values but somehow it doesn't want to ask for an operator (*, /, + etc). What's wrong with my code that the terminal skips the scanning part for the operator?
Code:
#include <stdio.h>
int main() {
int value1, value2, answer;
char operator;
[code]....
View 12 Replies
View Related
Apr 15, 2014
Just wondering if there was a standard way people add a version number to their c++ code? I can just define a variable or #define and write the version number to that, but wanted to know if there is a standard method people use?
View 1 Replies
View Related
Sep 2, 2013
This has never happened before but I imagine that I've somehow accidently disabled a library or such.
namespace SB{
namespace Data{
class DLL Filed abstract{
//DLL is a macro defined as either __declspec(dllexport) or __declspec(dllimport)
//depending on whether this is open as a project or a header
[Code]....
The error is from intellisense and is present on every occurrence of std::string
View 14 Replies
View Related
Mar 21, 2014
Here's my attempt:
input.open(name);
if (input.fail()){
cout <<"Error opening file"<<endl;
}
while (input>>numbers)
{
counter++;
total += numbers;
[Code]...
Copy of the output:
Error opening file
The Standard Deviation of all the numbers is: -9.25596e+061
Press any key to continue . . .
Its not giving me the right answer.
View 1 Replies
View Related
Mar 15, 2014
Unable to compute Standard Deviation
View 1 Replies
View Related
Feb 1, 2015
The program does compile the average and the mean correctly. I can't understand why the standard_deviation member function isn't applying the sqrt properly:
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
const int N = 10;
class Standard_Deviation {
[Code] ....
View 7 Replies
View Related
Mar 5, 2014
So I'm working on an assignment that is roughly about implementing the grep utility, only it has to be programmed in C. The weird nuance of the assignment is that while we are implementing the utility, we can use grep only we cannot pass grep a filename to search through(we are supposed to pipe a line from the file to standard input so that grep can examine it there.) Anyways, when I reach execlp, it will print out what is in stdin from the terminal, but it hangs at that point and I have to press Ctrl+Z to exit. I probably have the most difficulty with using this function, so I came up with a smaller scale model to get the basics down. Anyways, here's my code:
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int main(int argc, char* argv[]){
[Code] ....
View 10 Replies
View Related
Mar 18, 2015
I have an HTTP/1.0 webserver that I'm building in C that needs to exhibit CGI script functionality. Specifically, what I'm having trouble with is that I have two processes: process 1 is the webserver, process 2 is the CGI script. I fork in the webserver, and then call exec to run the CGI script (specifically, I used execv()). I've read from the CGI specifications in the RFC that in the case of a webserver receiving a POST request, the CGI script should read the arguments for the POST request from stdin. However, when I write to stdin, it simply echoes what was written to the terminal window and when the CGI script tries to read from stdin, it blocks.
So, with all that said, I'm pretty sure there is some simple conceptual explanation to my problem, but I can't figure it out. Do I need to use pipes or some form of interprocess communication to send the data from the webserver to the CGI script, or can it just be done with stdin (and possible stdout)?
View 2 Replies
View Related
May 2, 2013
How I can convert an ISO 8601 to a standard DateTime like dd/mm/yyyy.
The string is:
2013-01-03T00:00:00.0000000Z
And I'd want it to show it like so:
03-01-2013
I'm storing this in an SQLite Database and the code I use to store everything:
conn.Open();
command.Connection = conn;
command.CommandText = "insert into Test ([Date], [LogName], [Channel], [DateRecord], [SizeInBytes]) values"
+ "(@Date, @LogName, @Channel, @DateRecord, @SizeInBytes)";
command.Parameters.Add("@Date", DbType.String);
command.Parameters.Add("@LogName", DbType.String);
[Code] ....
the Visual aspect is that I use a datagridview to see the data, so the conversion would have to happen while I read and store the data in the database.
View 4 Replies
View Related
Mar 11, 2015
How can I parse an .xml file with just C++ Standard Library?
View 14 Replies
View Related