C :: Syntax Error At The End Of Input And Warning (multi-character Constant)

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


ADVERTISEMENT

C :: How To Remove Multi Character Constant Warning

Feb 20, 2013

Here's the line of code with the warning

Code: if((addressbook[3][num][4]=='-')&&(strlen(addressbook[3][num])=='10'))

Or what might be the possible causes of such a warning?

View 2 Replies View Related

C++ :: Multi-character Character Constant Error Message?

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

C :: Multi Character Is Showing Error

Mar 26, 2014

When i am entering single character instead of 'miz' then it is working great. But when i am using multi character like 'miz' it is showing error output. i did this program with c++ it is working but not working in c.When i am running this program it is showing {warning] multi character constant.

Code:

#include<stdio.h>
#include<string.h>
main()
{
char a;
printf("Please Enter your First Name: ");
scanf("%s",&a);

[Code]....

View 1 Replies View Related

C :: Distinguish Between Character Constant And String Constant

Feb 20, 2015

Can distinguish between character constant and string constant giving examples

View 1 Replies View Related

C :: Write Text And Find Frequency Of 1 Chosen Character In It - Input Error Handling

Dec 20, 2014

I'm new in programming, and trying to write a code in C. The requirement is following - to write a text, and to find frequency of 1 chosen character in it. The main thing is that program should check user input (for example, I want to check if user entered "char" --> then correct, or if entered "int" --> not correct). But the program still doesn't check. So I have:

Code:
#include <stdio.h>
int main(){
char c[1000], ch;
char i, count=0;
printf("Enter a text: ");
gets(c);

[Code] ....

Am I on my right way using if/else?

View 3 Replies View Related

C++ :: Error C2061 / Syntax Error - Identifier (string)

Apr 3, 2013

I've just recently started to learn C++, and I'm encountering some errors I can't seem to figure out.

InventoryItem.h:

Code:
#pragma once
class InventoryItem {
public:
InventoryItem(string name, int amount);
~InventoryItem(void);
string getName(void);
int getAmount(void);

[code].....

Errors:

Code:
1>d:c++consoleapplicationconsoleapplicationinventoryitem.h(6): error C2061: syntax error : identifier 'string'
1>d:c++consoleapplicationconsoleapplicationinventoryitem.h(8): error C2146: syntax error : missing ';' before identifier 'getName'

[Code] .....

View 14 Replies View Related

C/C++ :: Difference Between Compiler Error And Warning?

Jun 8, 2013

in c program what is the difference between a compiler error and a warning

View 1 Replies View Related

C++ :: Wap To Read A Character From User And Test Whether It Is A Vowel Or Constant

Jan 10, 2014

How to do this?

View 10 Replies View Related

C :: Syntax Error In Expression Near If

Feb 3, 2013

I am using code::blocks for c programming and when i take debugger in below code it show ..

a syntax error in expression near "if"..

I am just checking debugger ...

Code:
#include <stdio.h>
#include <string.h>
int main()
{
char s1[100];

[Code] ....

View 7 Replies View Related

C/C++ :: Do While Loop Syntax Error

Feb 28, 2014

I am just starting out with loops and I have run into an syntax error and for the life of me I cant find out the issue. Before it has been an issue of me forgetting to close my brackets but I am pretty sure I did that this time. I am trying to have the program keep looping the main menu until the user inputs a correct number.

float total_Bal = 0.00;
char user_Choice;
do
{

[Code]....

View 6 Replies View Related

C++ :: Declaration Syntax Error

Apr 20, 2012

I keep getting a "Declaration syntax error" at line ""int main()". Is there something wrong with my int main()? And how do I go about it? Here is the program:

#include<stdlib.h>
#include<iostream.h>
#include<stdio.h>
#include<math.h>
#include<conio.h>
float rung4(float x, float y, float h)
int main() {
float eps=0.00001;

[Code] .....

View 14 Replies View Related

C++ :: Syntax Error If Statement

Feb 19, 2012

I got syntax error in if statement ,, i checked the line i put { after the condition don't know where the mistake are

1>c:usershani est11 est11code.cpp(20) : error C2143: syntax error : missing ';' before 'if'

PHP Code:

# include <iostream>
using namespace std;
int seqsearch (int list[],int length,int key);
void main () {
    int marks [30];

[Code] ....

View 2 Replies View Related

C/C++ :: Declaration Syntax Error Handling

Jan 30, 2015

void main() {
     clrscr();  
     cout<<" Menu";
     cout<<"
1. Display all the employees' info.";
     cout<<"
2. Display specific employes' info.";
     cout<<"
3. Display employee with max salary.";

[code]....

Declaration syntax error at line 89, I don't get this everything is proper.

View 1 Replies View Related

C Sharp :: Getting Syntax Error In INSERT INTO Statement

Apr 6, 2012

if (comboBox1.Enabled == true && textBox5.Text != "")
{
OleDbConnection con = new OleDbConnection();
con.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;" + @"Data Source= c:usersmert" + @"documentsvisual studio 2010ProjectsPayrollCSWindowsFormsApplication7P ayrollDB.accdb";

[Code]....

this is my code. I am getting this error on "cmdole2" query.

error text is:

---------------------------

---------------------------
System.Data.OleDb.OleDbException (0x80040E14): Syntax error in INSERT INTO statement.
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextE rrorHandling(OleDbHResult hr)
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextF orSingleResult(tagDBPARAMS dbParams, Object& executeResult)

[Code]....

View 1 Replies View Related

C++ :: Initializing Direct2D Class - Syntax Error

Mar 16, 2012

I'm using a singelton class ( is this coded correctly?), and from the main class, im trying to initiliaze my Direct2D class, only I do get this error:

error C2143: syntax error : missing ';' before '.'

These lines gives it:

CSingleton.GetCDirect2DInstance()->CreateDeviceIndependentResources();

singleton.hpp

Code:
#ifndef CSingleton_h__
#define CSingleton_h__
#include "CDirect2D.hpp"
class CSingleton {
public:
static CDirect2D* GetCDirect2DInstance();

[Code] ....

View 9 Replies View Related

C :: Prime Number Function - Declaration Syntax Error

Jan 8, 2014

I wrote this program and compiled in turboc, but it gets error"declaration syntax error" .

Code:
#include <stdio.h>
int main()
int isprime(int n)
{
if(n<2)
return 0;

[Code] ....

View 5 Replies View Related

C/C++ :: Read Input File Character By Character?

Aug 10, 2012

How do I write an a program that will read an input file character by character?

View 1 Replies View Related

C Sharp :: Syntax Error In Update Query Using MA Access Database And Net 4.0

Feb 21, 2014

private void update_Click(object sender, EventArgs e)  {
            OleDbConnection conn = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;
Data Source=C:UsersshobhitDocumentsEnvironment_Monitoring.accdb;
Jet OLEDB:Database Password=divya6");
            String sdat = dateTimePicker1.Value.ToShortDateString();
            String la = labs.SelectedItem.ToString();

[Code] ....

View 1 Replies View Related

C++ :: Reading Specific Input Syntax - String Parsing

Apr 21, 2013

I need reading a specific input syntax.

something like

<Input> :: R C <Content>

3
3

.3. .15 9.2
.1. ..6 ...
6.5 7.. ...

... .5. ..9
4.7 .8. 1.6
9.. .6. ...

... ..1 7.4
... 6.. .9.
5.1 49. .3.

View 2 Replies View Related

C/C++ :: Sequential Matrix Multiplication Program - Syntax Error Near Unexpected Token

Apr 30, 2014

I wrote a sequential matrix multiplication program in c.

After execution i get error like
./mul.c: line 11: syntax error near unexpected token `('
./mul.c: line 11: `int main(){'

#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#define wA (30 * 16)
#define wB (50 * 16)
#define hA (80 * 16)
#define hB wA
#define wC wB

[Code] ....

View 4 Replies View Related

C/C++ :: Two Array Member Pass As Parameter - Expression Syntax Error For Function

Nov 8, 2013

In my project, GreedyKnap::calKnap(int nItem, int nCapacity, float fWeights, float fProfits);

This function include two array member pass as parameter. how can i do this?

View 1 Replies View Related

C++ :: Compiler Error - Expression Must Have A Constant Value

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

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++ :: Syntax Error In Function Call - Type Mismatch In Parameter In Function Sort

Jul 6, 2014

error says "cannot convert 'int*' to 'int' in function main()
and also
type mismatch in parameter in function sort(int,int)

Heres the code:
#include<iostream.h>
#include<conio.h>
void main() {
void sort(int,int);
clrscr();

[Code] .....

View 11 Replies View Related

C++ :: Error Reading Character Of String?

Jan 12, 2013

I am trying to record some information in a file and allow user to delete a record. I am facing this message in Autos section of MVS (Error reading character of string). Here is the code:

int removeRecord(string name, int &row)//remove a record
{
const string data="database.txt";
fstream records;
records.open(data.c_str());
const string cpData="temp.txt";

[code].....

If I delete the any row (except last roe) it works but then add a copy of last record (sometimes fully sometimes partially) at the end of the file!! if i delete the last record it does not do anything.

View 1 Replies View Related







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