Visual C++ :: Localize Big Number Mask
Feb 10, 2013
I have some strings that shows big number. I need to add commas to the big number so for example 9999999 become 9,999,999.
I need it to be localized and I know that some languages uses the char '.' instead of ',' ... How can I do it ?
View 3 Replies
ADVERTISEMENT
Nov 19, 2014
Code:
#include<stdio.h>
#include<stdlib.h>
float CalcFinal (float homework, float lab, float midterm, float finalexam) {
[Code]....
This assignment is basically to take marks from a txt file and display them and a final mark in another txt file. I've managed to do it, except for one thing. I'm not sure how to replace and ID number (eg. 1234577) with another that has the first 3 numbers masked (eg. xxx4577). How do I do this?
View 2 Replies
View Related
Jul 20, 2013
I have experiences to localize a few MFC executable files, first create a resource dll file then add following code in InitInstance():
Code:
BOOL CMyApp::InitInstance()
{
//Default Application Wizard code.
HINSTANCE hRes = NULL;
hRes= LoadLibrary("ResourceD.dll");
if(hRes)
AfxSetResourceHandle(hRes);
//Rest of wizard code
return CWinApp::InitInstance();
}
Now I need to localize a dll file which is an IE web browser toolbar, who could tell me how localize the dll file?
View 6 Replies
View Related
Feb 12, 2015
When creating an exception mask for a file, should an exception throw during a file operation, I can reset the state bits of the actual file using ios::clear().
Though after doing so, will the exception mask still throw an exception, thinking that the specified error state flags are still set to true? If so, how can I reset the exception mask so that it is ready to throw more exceptions should the appropriate situations arise in the future?
View 2 Replies
View Related
Jul 23, 2013
How would I be able to round a number in multiples of another...
Let's say width is 150
And multiple to be 64...
I want 150 to become 128...
if it was 160 to become 192...
The width number will change and I want to covert it in multiples of the other number example 64... The minimum value will always be the multiple number used...
View 7 Replies
View Related
Mar 19, 2014
I have a code that calculates the number of days between dates. It considers leap years and different days among months. The problem I have is when i debug the code nothing comes out.
Here is the code.
#include<iostream>
#include<fstream>
using namespace std;
bool wheep();
int daysinmonth();
bool wheep(int yr) {
if (yr % 400 == 0)
[Code] ....
this is the file its reading
1 7 9 1 10 9
View 3 Replies
View Related
Dec 10, 2013
i cant figure out what im doing wrong with my bubble sort. when i cout the sorted test scores, the first number(testScore[0])this is the code.
#include <iostream>
using namespace std;
int main()
{
[Code]....
View 2 Replies
View Related
Mar 4, 2013
Write a C++ program to calculate the fewest number of each denomination needed to pay a bill of amount TOTAL. For example, if the end user enters $97 for TOTAL, program will output that the bills would consist of one $50 bill, two $20 bills, one $5 bill, and two $1 bills. (Assume that the amount is in whole dollars, no cents, and only $100, $50, $20, $10, $5, and $1 denominations are available.) Aid: You may want to use the modulus operator %.
View 5 Replies
View Related
Apr 24, 2014
Apparently there are various methods (GetSystemInfo() / GetLogicalProcessorInfoEx() etc) which can return the number of available processors. But they usually return the number of logical processors and they're affected by stuff like hyperthreading. So for example, depending on how you get the information, a dual-core CPU can either return 1, 2 or 4 processors.
I've been asked if there's any simple way to retrieve the actual number of physical processor cores - i.e. such that a dual core CPU will always get returned as '2'. An 8-core CPU would return '8' etc.
View 9 Replies
View Related
Feb 22, 2015
I'm having trouble finishing this program. What I'm trying to do is create a class for Rational numbers. Get input from user for denominator and numerator. Store the numbers without a sign, and for the sign store it separately in char. I'm not supposed to use accessor functions. The part that I can't seem to know how to do is use the info that was stored in the addUp function. This function need to add two rational numbers. i need to make this function general enough that it can handle two fractions, or a fraction and a whole number, or two whole numbers. What I already have here is readin function which reads in the numerator and denominator. setnumerator and setdenominator to assign positive values. setsign should get the sign of the fraction. Finally addUp should addUp which I explained before. I have some ideas about writing the tests, but can't seem to know how to implement it to the program. The main program is still empty but all I'm supposed to do there is call the class functions.
Code:
#include <iostream>
using namespace std;
class Rational {
private:
int numerator, denominator;
char sign;
[Code] .....
View 14 Replies
View Related
Aug 13, 2013
I created an algorithm that uses imaginary numbers. It is fine on Dev C++, and now I am trying to port to VS2008. I figured out most things, including how to declare complex numbers. However, I've been having an incredible hard time trying to figure how to use the " i " number! For example:
In Dev C++:
Code:
z_cmplx = cexp(I * f1/Fs * 2 * PI);
Where "I" is a macro from the library!
In VS2008:
Code:
z_cmplx = std::exp(I * f1/Fs * 2 * PI);
Although I DID include <complex> library just like I did before, the compiler gives me: error C2065: 'I' : undeclared identifier.
View 10 Replies
View Related
May 14, 2014
I want to send a number to my OPENGL class from my main dlg. Im using a updated edit control.
here is my open gl code that will draw what I want
Code:
void COpenGLControl::oglDrawScene()
{char side[32];
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
glBegin(GL_LINE_LOOP);
for(int i = 0; i < 256; i++) {
glColor3f(1.0f,0.0f,0.0f);
glVertex3f( 1.0f, 1.0f, 1.0f);
[Code]...
I want to update the glVertex3f values when I enter numbers into edit controls on my main dialog
how can I send messages from my main dialog to the opengl class that I created?
View 1 Replies
View Related
Jan 19, 2014
I am programming in c++ with 'winpcap' . I read a .pcap file and after I want to get the source and destination of packets in that file. Here is a piece of my code:
Code:
////I define the sructures here
#pragma pack(1)
struct sniff_ethernet {
u_char ether_dhost[ETHER_ADDR_LEN]; /* Destination host address */
u_char ether_shost[ETHER_ADDR_LEN]; /* Source host address */
u_short ether_type; /* IP? ARP? RARP? etc */
[Code] ....
but the result is incorrect? where is the problem?
View 5 Replies
View Related
Dec 19, 2014
Write a C++ program that adds three binary numbers of 8-bit each. Every number is stored into an array of 8 elements.
Example:
Array A
0 1 2 3 4 5 6 7
0 1 1 0 1 1 1 0
+
Array B
0 1 2 3 4 5 6 7
0 1 1 0 1 1 1 0
+
Array C
0 1 2 3 4 5 6 7
0 1 1 0 1 1 1 0
Store the result into an array D of 8 elements. Your program should show the decimal numbers for every binary number. Print screen of 6 answers. This means you should try your program six times with different numbers in every run and show the printed screen result.
View 5 Replies
View Related
Sep 23, 2013
I need to make a programm to write in a excel cell a number.
I must use OLE Automation. How i can do it??
Code:
#include "stdafx.h"
#include <stdio.h>
#include <windows.h>
#include <ole2.h>
#include <assert.h>
#include <iostream>
void main(void) {
CLSID clsid;
CLSIDFromProgID(L"Excel.Application", &clsid);
[Code] ....
View 1 Replies
View Related
Oct 21, 2012
Can not even say this is the error as it is giving me 45 errors. l am writing code which accept employee type based on calculating the miles traveled in a year,my code is based on type of employee, number of vacation days used and no of sick days used.
#include <iostream>
#include <iomanip>
#include <conio.h>
class employee {
int emp_type;
float emp_vacation;
[Code] ....
View 11 Replies
View Related
Oct 21, 2013
I am writing a game that is 2 to 4 players. i am wondering how to ask how many players, and make the score stay with each player. it is a rip off of zombie dice, this is what i have so far the playerScore array is to hold the score for each player and the turn array is hold hold the values that they rolled that turn, i also dont know how to clear out the turn array when it goes to the next player.
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <ctime>
using namespace std;
int main() {
int playerScore[4];
[Code] ....
View 3 Replies
View Related
Apr 9, 2013
I am having one issue with my project. We are making a game of Nim code.I'm 99% done with it, i worked hard on it and i feel like i did a good job, however my project is not displaying the matches i want. For example, it display's the inital number of them 23. But once the first player subtracts a number, it doesn't display matches for player 2, just the number of matches remaining. Then as i keep running the program the same thing happens. This is what it's supposed to
output:
"Input/Output sample
WELCOME TO NIM
------- -- ---
Enter the starting player's name (no spaces)-->John
Enter the second player's name (no spaces)-->Mary
There are 23 matches.
ooooooooooooooooooooooo
|||||||||||||||||||||||
Player John please enter the number of matches to remove-->2
There are 21 matches.
ooooooooooooooooooooo
|||||||||||||||||||||
Player Mary please enter the number of matches to remove-->3
There are 18 matches.
oooooooooooooooooo
||||||||||||||||||
Player John please enter the number of matches to remove-->1 "
This is entire code.
#include <iostream>
#include <string>
using namespace std;
int main() {
// Holds variables.
[Code] ....
I will attach my code as well.ProjectNim.cpp
View 7 Replies
View Related
Oct 23, 2012
I need a slider with number displayed inside the slider. Slider thumb or number should be moved and finally i need to fetch the value where the slider thumb is placed. I had attached the image of slider which i required.
[URL]
View 4 Replies
View Related
Oct 9, 2013
I was told to use a round function to round a number to give an integer number that is closer to the real value. (for example if the number is 114.67 I need to print an int value of 115 instead of 114)
I am not exactly sure how a round function works, but I am told to include math.h library. What I try doesn't seem to work.
View 1 Replies
View Related
Feb 6, 2014
In this program what i'm doing is to search for a number when the vector is in order, and count how many times that number appears, the problem is that count how many times the number does not appear, but when its appear the program stays in an "standby mode" and the cursor does not move.
int buscarNumOrdenado (int x [MAX]) //MAX is the define {
int num,d, LimiteInferior, LimiteSuperior,mitad;
d=0;
LimiteInferior = 0;
LimiteSuperior = MAX-1;
[Code] ....
View 2 Replies
View Related
Nov 3, 2013
I need to write a program that will allow the user to enter a number "n" and the program tell you that the nth prime number is .....
EXAMPLE
user enters 55
printf("The 55th prime number is %i", variable");
View 1 Replies
View Related
Apr 26, 2013
I need to write a code in c++ , to input decimal number and the output to be number in Scientific notation with 32 bits .
View 1 Replies
View Related
Feb 19, 2014
So I have a template, part of a larger code, that is designed to calculate the number of multiplications it took to reach a certain number. The problem is, whenever I execute the program, mults is always printing out a strange number, perhaps its actual address.
template <class T>
T power3(T x, unsigned int n, unsigned int& mults) {
if (n == 0) return 1;
if (n == 1) return x;
if (n == 2){
[Code] ....
View 10 Replies
View Related
Nov 20, 2014
I am attempting to write code that receives a number from the user and outputs the largest prime number underneath the user's number. There are no errors in my code, but no matter what number is imputed, the program says the largest prime number is 1. I cannot find where the issue is in the code. Here is the code I wrote:
#include <cstdlib>
#include <iostream>
#include <cmath>
using namespace std;
bool isPrime(int num);//function prototype
[Code] ....
View 2 Replies
View Related
Sep 26, 2012
I'm running a game online and designing a program to generate Enemy Stats. Basically, it's supposed to generate 25 numbers between 0 and 7(to represent 8 Attributes on a 25 Point Buy system) and count how many times each number shows up.
Here's what the code looks like:
Code:
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
int Generate() {
int r= rand();
int s= r%7;
[Code] ....
And here's two outputs.
1: Code:
12133089220 12133089220 12133089220 12133089220 12133089220 12133089220 12133089220 12133089220 12133089220 12133089220 12133089220 12133089220 12133089220 12133089220 12133089220 12133089220 12133089220 12133089220 12133089220 12133089220 12133089220 12133089220 12133089220 12133089220 12133089220 Stats[0]= 25 Stats[1]= 0 Stats[2]= 0 Stats[3]= 0 Stats[4]= 0 Stats[5]= 0 Stats[6]= 0 Stats[7]= 0 Stats[8]= 0 Disallowed system call: SYS_socketcall
2: Code:
14787708434 14787708434 14787708434 14787708434 14787708434 14787708434 14787708434 14787708434 14787708434 14787708434 14787708434 14787708434 14787708434 14787708434 14787708434 14787708434 14787708434 14787708434 14787708434 14787708434 14787708434 14787708434 14787708434 14787708434 14787708434 Stats[0]= 0 Stats[1]= 0 Stats[2]= 0 Stats[3]= 0 Stats[4]= 25 Stats[5]= 0 Stats[6]= 0 Stats[7]= 0 Stats[8]= 0 Disallowed system call: SYS_socketcall
Note that the number does change, but only between runs.
View 3 Replies
View Related