C :: How To Enable Numeric Variables

May 22, 2013

working on this code I have encountered a few issues. My program lists the occurrence of each letter but i'm unsure of how to enable numeric variables. how to improve the overall quality of the code.

Code:

#include <stdio.h>
#include <string.h>
int main()
{
char string[100], ch;
int c = 0, count[26] = {0};
printf("Enter a string

[Code]...

View 4 Replies


ADVERTISEMENT

C# :: How To Disable And Enable LAN Connection In WPF

Jun 22, 2014

i have tried to search on the Internet but haven't found a suitable result that links in with what I want to do, that is to creation a WPF application and when you press a enable button it will enable the LAN and when I click the disable button it will disable the LAN until i click the enable button again. Now I know how to creation a WPF and the buttons, but how would I do the disabling LAN and enabling LAN?

By LAN i mean just the networking adapters, so that the PC cannot connect to a router and then the Internet.

View 14 Replies View Related

C++ :: Enable / Disable Menu Item

Nov 19, 2013

I have ploughed through the exchanges in all the forums, yet I still cannot make it work. The following is a tiny Code::Blocks program, written to isolate the problem:

// resource.h
#define IDR_MYMENU101
#define ID_FILE 102
#define ID_DISABLE103
#define ID_ENABLE 104
#define ID_MESSAGE105
#define ID_EXIT106

[code].....

case ID_ENABLE is similar to case ID_DISABLE above, and neither works. case ID_MESSAGE and case ID_EXIT both works as expected.I have tinkered with EnableMenuItem(), but without success.

View 8 Replies View Related

C++ :: Enable If With Variadic Template Arguments

Sep 17, 2014

template <typename FIRST, typename... REST, typename std::enable_if<std::is_convertible<FIRST, Base*>::value>::type* = nullptr>
void foo (FIRST first, REST... rest) {}

that successfully allows me to enable the function foo() only if FIRST is convertible to Base*, but I also only want foo() enabled if each type in REST... meets the same condition. What is the syntax for that? If no such syntax exists, how to achieve that effect?

View 7 Replies View Related

Visual C++ :: Enable Virtualization In 64bit Mfc App?

Dec 5, 2012

I have a version of an app in 64bit but the problem is under program files on windows 8 64bit it doesn't have access to the programs files folder... usually virtualization will redirect it to the virtual store but with 64bit exe's this doesn't happen automatically. How do I enable it in code or in the manifest file?

From MSDN:

Virtualization is only enabled for:

32 bit interactive processes
Administrator writeable file/folder and registry keys
Virtualization is disabled for:

64 bit processes
Non-interactive processes
Processes that impersonate
Kernel mode callers
Executables that have a requestedExecutionLevel

View 1 Replies View Related

C++ :: How To Enable Array To Count Items From A Group

Dec 27, 2013

Arrays are by far the most fun to work with and I really need see if its possible to enable an array to count apples, pears, peaches, from a group of three each.

If any of the fruit groups were chosen how might an algorithm be put together to count how many were chosen from each group. But lets take into consideration that these fruit groups are not supposed to be randomly generated, instead they belong as an array with certain amount of chosen occurrences. To show how many fruits were chosen from each group example, 1 from group 1, 2 from group 2, 3 from group 3 the out put is the important part because it shows the group and the occurrence of that group. the algorithm should be able to display the group with an occurrence as well

View 1 Replies View Related

C++ :: Enable Client To Iterate Internal Vector

Nov 26, 2012

The example enable a client to iterate the internal std::vector using being() and end().

Code:
class foo {
public:
typedef std::vector<std::string>const_iterator iter;
iter begin () const;
iter end () const;

[Code] .....

In the future I see the need for this class to be able to control sequence (sorting) and also show a subset of the complete list based on a search parameter.

Using std::sort appear to solve the ability to sort the collection.

How can I return an iterator to the client which only iterates a sub-set of all items in the std::vector?

An example would be, I add this method to the class;

Code:
void find(const std::string& st);

So if the client performs (below) only items in std::vector that contains the character "a" should be possible to iterate.

Code:
foo f;
f.search("a");

One option would be to operate with two collection inside the foo class. One more static containing all items and the other containing the sorted and filtered items. This would lead to some copying but should work. Far from perfect.

View 2 Replies View Related

C/C++ :: Enable User To Upload Image And Convert It Into ASCII Text Using SDL

Apr 29, 2015

Using C . I have been tasked (for a University assignment) to create a program that will enable a user to upload an image and convert that image into ASCII text using SDL on a Linux system. I've managed to open a window, display an image (non-selected) and convert it into grayscale using

case SDLK_g:
for (int y = 0; y < image->h; y++) {
for (int x = 0; x < image->w; x++) {
Uint32 pixel = pixels[y * image->w + x];
Uint8 r = pixel >> 16 & 0xFF;
Uint8 g = pixel >> 8 & 0xFF;
Uint8 b = pixel & 0xFF;
Uint8 v = (0.212671*r)+(0.715160*g)+(0.072169*B)/>;
pixel = (0xFF << 24) | (v << 16) | (v << 8) | v;
pixels[y * image->w + x] = pixel;

I am absolutely clueless as to how I can get the user to upload an image to the program and then begin the image -> ASCII conversion. I've found seem to be written in C++ or C# to make the conversion I should be using the GetPixelColour command?

View 14 Replies View Related

Visual C++ :: Enable Writing To And Reading From Files - Unresolved External Symbol

May 13, 2013

Perhaps this can be a very popular error,

Code:

#include <stdio.h>
#include <tchar.h>
#include <iostream>
#include <string>
#include <fstream>// enable writing to and reading from files
#include <cstdlib>
#include <time.h>
using namespace std;
class Person {

[Code] .....

Error list:

Code:

Error 1 error LNK2019: unresolved external symbol "void __cdecl saveperson(void)" (?saveperson@@YAXXZ) referenced in function _main H:Cry_DevProgrammingC++Using_class_ in_ c++Using_class_ in_ c++Using_class_ in_ c++.obj
Error 2 error LNK2019: unresolved external symbol "void __cdecl displayperson(void)" (?displayperson@@YAXXZ) referenced in function _main H:Cry_DevProgrammingC++Using_class_ in_ c++Using_class_ in_ c++Using_class_ in_ c++.obj
Error 3 error LNK2019: unresolved external symbol "void __cdecl editperson(void)" (?editperson@@YAXXZ) referenced in function _main H:Cry_DevProgrammingC++Using_class_ in_ c++Using_class_ in_ c++Using_class_ in_ c++.obj
Error 4 error LNK1120: 3 unresolved externals H:Cry_DevProgrammingC++Using_class_ in_ c++DebugUsing_class_ in_ c++.exe 1

What I can do to fit this problem?

View 14 Replies View Related

C :: How To Check Input For Non Numeric Value

Mar 20, 2013

Description: This program asks the user to enter a Fahrenheit temperature and then converts it into Celsius and Kelvin temperature.

Code :

#include <stdio.h>
void Temperatures(double temp_F);
int main(void) {
double temp;

[Code]...

View 6 Replies View Related

C++ :: How To Convert Char Into Numeric Value

Jan 1, 2015

when I was looking for a way how to convert char into numeric value for std::cout I found some old discussion with this statement: Operations on unsigned int are typically faster than on unsigned char, because your processor cannot fetch single bytes but has to get at least a multiple of 4 and mask out the other 3 bytes. Is this true? By using smaller (in bytes) variable I actually slow down my program? I always thought that it is a good practice if I use the smallest variable which will do the work. Is it also dependent on a compiler and OS?

View 2 Replies View Related

C# :: Possible To Convert Char Into Numeric Value

Feb 22, 2014

I want to avoid converting the char[] into a string as an intermediate step, since I'm trying to write some "string" parser helpers which don't allocate a bunch of different strings onto the heap. (whole point of this little project is to reduce GC pressure in applications that do alot of string parsing).

basically if I have a char[] that contains {'1','2','3'}, I'd want to to be converted into 123.

I tried messing around with the stackalloc operator in C#, but its illegal to stackalloc a string unfortunately. I also googled around for converting a char[] into a numeric value, but all the solutions convert each individual char into their ASCII code, or convert the char[] into a string as an intermediate step.

View 12 Replies View Related

C# :: Creating Object That Uses Numeric Up / Down And Track Bar?

Nov 19, 2013

I want to create an object that uses visual C#'s Numeric Up/Down and a Track bar.

The reason is that I have a GUI that uses lots of these linked together with events and I want a common event handler for all of them.

Maybe just adding a property that is a Numeric Up/Down in the Track bar and vice-versa will allow me to create a common event for all of these pairs.

View 1 Replies View Related

C++ :: Numeric Conversion - How To Convert Int Into String

Jun 3, 2013

How to convert int into string ? I had done conversion string to int.

My code :

/*Convert string into int using stringstream */
#include <iostream>
#include <string>
#include "console.h"
#include <sstream>
using namespace std;

[Code] .....

View 3 Replies View Related

C++ ::  Expected Identifier With Numeric Limits

Aug 22, 2014

I'm trying to perform a simple input operation, and check to make sure that whatever the user input is a valid input (is within data type bounds, is correct data type...). But when I get to ignoring the input, I keep getting an error.

unsigned short num;
while (true) {
std::cin >> num;
if (std::cin.fail()) {
num = 1;

[Code] ....

I don't fully understand why this error is here.

View 6 Replies View Related

C/C++ :: Numeric Score To Letter Grade

Feb 9, 2015

The code runs but asks me for my score twice then just comes to an abrupt end with out giving me a letter grade.

#include <stdio.h>
int getScore(void);
char convertGrade(int numscore, char letterGrade);
void showGrade(int numscore, char letterGrade);

// Function to prompt for and read a numeric score
// Returns an integer score as read in using scanf

[Code] ....

View 12 Replies View Related

C/C++ :: How To Multiply And Divide 2 Numeric String

Mar 28, 2014

I want to multiply and divide 2 string that contains number. For example

s1=4 and s2=8 s1*s2=32 ,s2/s1=2

I don't want convert string to integer and do it.because i deal with big numbers.and these should be in string form.

View 1 Replies View Related

C Sharp :: Numeric Up Down Hides Its Value From The User

Oct 17, 2014

I have a button which selects a particular tab and tab page on a form. This tab page has an embedded tab control with several more pages.

When I click on this button, the desired tab page is selected, but the NumericUpDown value (which is on the tab page) is not visible. The value is the current year.

Could it be that somehow, the click event for the button is hiding the value?

View 8 Replies View Related

C/C++ :: Error Before Numeric Constant Location

Jul 9, 2013

this is my code in c++ and its very simpile but wont compile

#include <iostream>  
using namespace std;  
int main() {  
    cout << "Here is some text 
";
    cout << "Here is a number: ";

[Code] ...

View 1 Replies View Related

C++ :: How Can Numeric Values Stored As Strings Be Converted To Numbers

May 16, 2013

I need to check my understanding from some questions about strings. How can numeric values stored as Strings be converted to numbers?

a)vector of required numeric data type
b)atoi function in cstdlib library
c)cout statement with required numeric data type

I picked b), I am aware of atoi, atol, and atof as methods to convert, but are there other methods?

What is the purpose of strncat function?

Combines n characters from source string into target string

C++ string provides:

a)convenient way to declare and manage character arrays
b)functions to manipulate strings
c)all of the above
d)none of the above

I picked c)

View 2 Replies View Related

C/C++ :: Read In Numeric Representation Of Date And Prints It Out In Formatted Manner

Oct 13, 2014

Write a program that reads in the numeric representation of a date and prints it out in a formatted manner as the box below.

1. If the user entered an invalid number for the month it should display "Invalid Month"
2. If the user entered an invalid number for the date it should display "Invalid Date"
3. Check to see if the day is outside the range for that particular month

An example of the input and the output:
Enter the date: 1 24 2013
The date you entered is: 1242013

Im not sure on how to go about this problem, but this is what I have.

#include <stdio.h>
int main(void) {
int a, b, c;
int status;
printf("Enter the Date");
status = scanf("%d,%d,%d",&a, &b, &c);
printf(" The Date is : %d",status);
return 0;
}

Am I going about this right? Is there an easier or better way to go about it? All that happens is that the program reads the first number and spits that back out.

View 5 Replies View Related

C# :: SQLException - Error Converting Data Type Varchar To Numeric

Oct 22, 2014

I am writing a simple program to suck in a txt file then pump it into sql.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Data.OleDb;
using System.Data.SqlClient;

[Code] ......

How I can get past this error and get the data into sql? I read a couple articles on .tag but not sure I understand what to do.

View 11 Replies View Related

C :: Write A Program That Converts Alphanumeric Phone Number Into Numeric Form

Mar 6, 2015

i m learning c programming and i m stuck with this program for some reason.Write a program that converts alphanumeric phone number into numeric form:

O/P:
Enter phone number: CALLAT 2255288
here is the code i have written:
/** compilers shows no error **/
and O/P I get is
Enter phone number: CALLAT
/**blank space***/

Code:

#include<stdio.h>
int main(void)
{
char ch;
printf("Enter phone number:");
ch=getchar();
}

[code]....

View 4 Replies View Related

Visual C++ :: Enable / Disable Menu Item 2 In OnUpdate Handler Of Menu Item 1?

Sep 15, 2014

I have two menu items. When item 1 is disabled, I want item 2 to be disabled as well. In the OnUpdate handler of menu item 1, I have tried to use "t_pMenu = pCmdUI->m_pMenu;", "t_pMenu = pCmdUI->m_pSubMenu;" and "t_pMenu = pCmdUI->m_pParentMenu;" but I always get NULL t_pMenu. How can I achieve this purpose?

Code:
void CDummyView::OnUpdateMenuItem1(CCmdUI* pCmdUI)
{
if(m_bShowMenuItem1) {
pCmdUI->Enable(TRUE);

[Code]....

View 14 Replies View Related

C++ :: Specifying And Multiplying Two Variables

Feb 23, 2014

I'm very new to C++ so I've been trying to run through some code examples to begin to learn basic structures and syntax, but I've recently run into a problem using examples from the 7th ed. of Sams Teach Yourself C++. I'm using the code provided within one of the examples that allows you to specify and multiply two variables, but when I compile and run the executable the final output seems to only show the first variable and b/c of this the multiplication operation does not work.

Here is a my example code:

Code:
#include <iostream>
using namespace std;
int main() {
cout << "This program will multiply two numbers" << endl;

[Code] ....

View 3 Replies View Related

C++ :: Adding 3 Variables One After The Other

Nov 19, 2013

So here is what i need i need a way i can add 3 variables one after the other example:

int a = 1;
int b = 2;
int c = 3;

//Here comes my problem

int d = a + b + c;

When I write it like thet d = 6 ,
but I need it to be 123,

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved