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
ADVERTISEMENT
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
Apr 2, 2013
Here is my code so far, the problem is when I debug it I keep getting the same error but everything seems to be correct.
The error is: Unhandled exception at 0x00ED8F34 in ENCDEC.exe: 0xC0000005: Access violation reading location 0x00000008.
#include <iostream>
#include <fstream>
#include <string>
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <ctype.h>
using namespace std;
char buffer[100];
class cSecret{
[Code] .....
View 1 Replies
View Related
May 20, 2014
I am trying to run this source code but i am getting the compiler error Expression Must Have a Constant Value. I tried making both the variables x and y constants and assigned them to a significantly big number but then i am getting the error expression must be a modifiable lvalue.I have made comments in the code in front where Visual Studio is giving me the syntax error (red squiggly line).
#include<iostream>
#include <string>
#include<cmath>
using namespace std;
int main(){
int x;
int y;
[Code] ......
View 3 Replies
View Related
Feb 18, 2013
Here's my code. The error's at the last line.
Code:
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#define max_con 30
void add_contact();
void edit_contact();
void del_contact();
void list_contact();
[Code] .....
View 6 Replies
View Related
Feb 20, 2015
Can distinguish between character constant and string constant giving examples
View 1 Replies
View Related
Sep 14, 2014
I keep getting this warning message and I do not know how to fix it. Is it because I'm using char to instead of strings to replace all 't' with 'lp'?
#include<iostream>
#include<string>
#include <stdio.h>
using namespace std;
char * scanf(char * a) {
[code]....
View 6 Replies
View Related
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
View Related
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
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
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
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
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
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
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
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
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
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
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
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
Dec 28, 2012
#include <iostream>
class Hello {
public:
void Test() {
[Code].....
As i know a non-constant member function cant be called inside a constant member function but how the above code has been compiled successfully and giving the expected result .
View 5 Replies
View Related
Jul 12, 2013
In the code below. I believe I am returning the memory location of the value I am looking for. How can get the value?
main.cpp
int choice = 0;
PlayerMenu *newPM = new PlayerMenu;
File *file = new File;
// Menu for loading, creating or exiting the game
choice = newPM->menuChoices();
PlayerMenu.cpp
[Code] ....
I am not sure how to deference the value so I can get at the value instead of the memory location.
View 5 Replies
View Related
May 23, 2013
Here's my code, my problem is that it is not sending the keystrokes to the LOG.TXT file I want them to be going to.
1 #include <iostream>
2 using namespace std;
3 #include <windows.h>
4 #include <winuser.h>
5 #include <stdio.h>
6 int save (int key_stroke, char *file);
[Code] ....
View 1 Replies
View Related
Mar 14, 2015
How can i get the Location of an Image used by the ToolStripButton? I need the locaton to detect if the cursor is above the image that i use for the button. I tried it like this:
private void ToolStripButton_MouseHover(object sender, EventArgs e) {
Graphics formGraphics = this.CreateGraphics();
GraphicsUnit graphicsUnit = GraphicsUnit.Point;
RectangleF imageBoundsF = reloadToolStripButton.Image.GetBounds(ref graphicsUnit);
[code].....
The problem is that i have the width and the height but the location is always 0 or x and y are always 0, so how can i do it?
View 2 Replies
View Related
Jun 6, 2012
Any difference between
Code:
class SomeOtherClass;
void foo(SomeOtherClass* p);
And
Code:
void foo(class SomeOtherClass* p);
I was told that "2" would limit the scope of the forward declaration to the declaration of foo... However, after testing it, it appears that both behave the same...
View 3 Replies
View Related
Feb 1, 2014
I recently started learning C++ and wanted to deep a bit into process memory reading for Windows, but I get an error I don't know how to fix. I'm using Visual Studio Express 2013 as my IDE and it tells me this, when I try to run and debug:
"Unhandled exception at 0x77E3E243 (ntdll.dll) in readProcessMemory.exe: 0xC0000005: Access violation reading location 0x00000043."
The Call Stack window says following:
ntdll.dll!_NtRaiseException@12() Unknown
ntdll.dll!_KiUserExceptionDispatcher@8() Unknown
ntdll.dll!_RtlInitUnicodeString@8() Unknown
> readProcessMemory.exe!main() Line 8 C++
[External Code]
And in the Output window is this: First-chance exception at 0x77E3E243 (ntdll.dll) in readProcessMemory.exe: 0xC0000005: Access violation reading location 0x00000043. Unhandled exception at 0x77E3E243 (ntdll.dll) in readProcessMemory.exe: 0xC0000005: Access violation reading location 0x00000043.
My code should be extremely simple, I'm just trying to find a Windows window. But here's the code.
Code:
#include <windows.h>
#include <iostream>
using namespace std;
int main(){
[Code] ......
View 10 Replies
View Related