C :: Not Getting Required Result

Apr 30, 2013

Code:
void search(){void output(void);
char title[20],;
char *p;
clrscr();

[Code] ......

Info:Program that stores information about reports .the above function searches the report according to its title. list is the name of the structure that stores the records.

Why i'm using strstr:

for eg. there is a report titled 'report on tigers'

I want the report information to be output if someone searches for 'tiger'

Output:displays all the entries i have made till now

file is attached.

View 4 Replies


ADVERTISEMENT

C++ :: Why Using Namespace Required In Linux But Not In Turbo

Jan 8, 2015

Why is using namespace needed in linux but not in turbo c++?

View 1 Replies View Related

C/C++ :: Lvalue Required For Function Main

Sep 5, 2014

I actually am wanting to practice on a 2 dimension char array. so, I am using the below program and getting the error - Lvalue Required For Function Main

#include <stdio.h>
#include <conio.h>
#include <string.h>
char varStringArray[1][5];
int main(void) {
clrscr();
varStringArray[0] = 'a';
printf("%c", varStringArray[0]);
return 0;
}

View 2 Replies View Related

C++ :: Dividing Two Floats Not Giving The Required Quotient

Jan 9, 2014

Im using the remquo function in the cmath library as follows:

int quotient;
double a = remquo (10.3, 4.5, "ient);

This gives the correct remainder (a = 1.3) and quotient (quotient = 2).

Infact about 50% of the answers are right when I play around, however, trying something like:

int quotient;
double a = remquo (2.25, 1.5, "ient);

yields an incorrect quotient of 2 and remainder of 0.

I do think this has something to do with float arithmetic. I recall tinkering with the float number 0.500 and that the CPU actually saves it as 0.50000000000000231. However if my suspicion of float arithmetic as the suspect is correct, I do not understand why a tenth decimal would make such a drastic difference as changing the quotient result.

View 10 Replies View Related

C :: Error - I Value Required As Left Operand Of Assignment

Apr 21, 2013

I am getting this error when compiling my program with quincy:

Error: I value required as left operand of assignment

The program is meant to calculate how much parking costs based on the amount of hours in a park and what type of vehicle it is. the error is coming from my function definitions which i have just started to add in.

Code:
float calcCarCost (char vehicletype, int time, float car)
{
if ((time > MINTIME) && (time <= 3))
calcCarCost =( CAR * time );
}

The error is on line 72 which is:
calcCarCost =( Car * time);

I should probably point out CAR is already defined as a constant with a numerical value given and time is previously asked to be input in when the program runs.

View 10 Replies View Related

C :: Find The Least Amount Of Coins Required To Make A Value

Mar 8, 2014

Write a program in C that will allow a user to enter an amount of money, then display the least number of coins and the value of each coin required to make up that amount. The twist to this program is the introduction of a new coin - the jonnie (value = $1.26). Therefore, the coins available for your calculations are: Twonies, Loonies, Jonnies, Quarters, Dimes, Nickels and Pennies. You can assume the amount of money user enters will be less than $100.00.

User enters $4.53. Your output should be:

The least number of coins required to make up $4.53 is 4. The coins needed are:

1 Toonie $2.00
2 Jonnies $2.52
1 Penny $0.01
$4.53

I'm wondering if i'm close. I'm stuck on what to do for the output. This is what i have so far.

Code:
//Start
#include <stdio.h>
int main() {
//Get user input for amount of money

//Input
int i;
//Store input from user

[Code] .....

View 3 Replies View Related

C++ :: Why Asterisk Required On Smart Pointers For Assigning Value

May 19, 2013

When i try to compile this code it gives me a error during run-time saying "*program name* has stopped working"

Code:
#include <iostream>
#include <memory>
using std::cout;
using std::endl;
using std::unique_ptr;

[Code] .....

Why is this happening? Also why do you need the asterisk on smart pointers to assign them a value? Is it just because, or is there a reason.

View 5 Replies View Related

C++ :: Number Required After Prime Numbers Addition

Apr 24, 2013

I have to write a code in which the addition of prime number gives the number user input..

for example if user enters 10 then

7+3 = 10
2+3+5 = 10

View 2 Replies View Related

C/C++ :: Pointer To Structure Required On Left Side

May 3, 2014

#include<conio.h>
#include<alloc.h>
#include<string.h>
struct node

[Code]....

View 3 Replies View Related

C :: Lvalue Required For Left Operand Of Assignment Error

Oct 18, 2013

The issue arises with case 3 where it tells produces an error when I attempt to compile and says "lvalue required for left operand of assignment error". How to fix this so that I can properly run the program.

View 5 Replies View Related

C++ :: Enter Decimal Number Into Program And Required Base

Oct 12, 2013

You enter decimal number into the program and what base you want. The integer part of the decimal is being handled fine, but the decimal is not.

For example, I enter 15.6847 and base 10, which means I'm going from base 10 to base 10. It spits out 68469999999999 for the decimal part. (Do not worry about the first block of numbers. The second block seperated from the first by a space is where the decimal will appear in order.)

#include <iostream>
#include <string>
#include <math.h>
using namespace std;
int baseConverter(int, int, int *, int *);

[Code] ....

View 2 Replies View Related

C++ :: Error - LValue Required As Left Operand Of Assignment

Jan 1, 2014

I get the following error:

pointers_array.c: In function ‘readlines’:
pointers_array.c:42:37: error: lvalue required as left operand of assignment

I know what the error is saying but what it is giving it with this code:

/* readlines: read input lines */
int readlines(char *lineptr[], int maxlines) {
int len, nlines;
char *p, line[MAXLEN];
nlines = 0;

[Code] ....

View 3 Replies View Related

C++ :: Painting Company - Calculate Amount Of Paint Required For Every Contract

Dec 15, 2014

You work for a painting company. Your job is to calculate the amount of paint needed for every contract assigned to the company. This time, you need to paint an outside wall. The dimensions of the wall are 5 X 7m. The window is a circle with the radius of 1m. Write a program that would calculate the following:

The amount of paint needed knowing that you need 1 gallon per 10 square meters. The amount of time to complete the job knowing that it takes 1 hour per 10 square meters to prepare the surface, 5 minute per square meter to pant it and 5 minute per square meter to clean up the area.

View 8 Replies View Related

C++ :: Socket Program - Lvalue Required As Left Operand Of Assignment

Feb 5, 2013

I got above error in my program. My program is socket program. I am using ubuntu 11.10.

#include <netdb.h>
#include <netinet/in.h>
#include <string.h>
#include <cstdlib>
#include <iostream>
#include <stdio.h>

#define PORT 4547
/*int parseARGS(char **args, char *line) {

[Code] ....

View 4 Replies View Related

C++ :: Installed Cygwin - Mingw Install Required In Order To Use DirectX?

Jan 20, 2014

Goal: I want to use cygwin g++ to write DirectX applications.

I know that one of the mingw packages contain directx libraries.

Now that I have installed cygwin, can I use directx also?

BTW, does netbeans open a mingw project using cygwin tool chain?

View 5 Replies View Related

C Sharp :: Programmatically Start A Process And Enter Required User Name And Password?

Apr 21, 2013

Using C#, is it possible to programatically start an application and enter a required user name and password

View 2 Replies View Related

C++ :: Add Data To Text Files Which Are Required To Store 3D Scan Data

Jul 10, 2013

I have written the following code to add data to text files which are required to store 3D scan data (I have to calculate the y-coordinate). My code seems to work except that it stops working when I want to create more than ten text files i.e. the directory I am trying to store them in will not hold any more than ten text files. Code is shown below.

#include <string>
#include <locale>
#include <iomanip>
#include <iostream>
#include <fstream>
#include <sstream>
using namespace std;

[Code] ....

View 1 Replies View Related

C++ :: How To Pass By Value-Result

Dec 4, 2014

I'm trying to understand the pass by value-result. The code I have came up with so far only does by value and by reference, which I understand. The value-result is what has me stumped, and honestly I am unsure how to write the function for it. Here's my code so far...

#include <iostream>
using namespace std;
// Function prototypes.
void swapByValue(int, int, int);
void swapByRef(int&, int&, int&);

[Code] ....

View 4 Replies View Related

C++ :: Bad Value Result From Operator Using Objects

Jul 24, 2013

I keep getting an undesired value in this code. I've tried several methods, but none are giving me the correct answer. The out put is always zero, when in this case it should be 10!!

Here's the object structure:

template<class T, class _b>
struct quantity {
private: T value;
public:
explicit quantity(T val): value(val) {};
T getValue() { return value; };

[Code] .....

Here's the operation:

int main() {
quantity<int, bool> m(20);
quantity<float, bool> m_f(10);
quantity<double, bool> m_d(NULL);

m_d = m_f;

[Code] .....

Why does it seem that the assignment operator is the harder operator to overload? Maybe it's just my luck, but I seem to always run into issues whenever I work with it. I hardly ever experience errors when overloading any of the other operators.

View 6 Replies View Related

C++ :: How To Display Result With Decimals

Nov 6, 2014

I am trying to make the code below display the result with decimals. I tried using setprecision, but I am not too sure where to put it. I placed it in cout section where the answer is but it still doesn't come out correctly.

#include <iostream>
using namespace std;
//*Delcare function prototype*
int ConvertToCentimeters (double, double );
//declare exception class*
class NegativeNumber

[Code] ....

View 4 Replies View Related

C++ :: Size Of Result With Struct Var

Apr 20, 2013

typedef struct Element Element;
struct Element {
char x;
double* y;

[Code] .....

This one with y pointer gives 8

typedef struct Element Element;
struct Element {
char x;
double y;

[Code] ....

This one with a normal y variable gives 12

View 7 Replies View Related

C/C++ :: How To Use Result Of If Statement Later On In The Code

Nov 19, 2014

how to use the result of an if statement in my program. I'm writing a program for a knockout tournament, so i want to extract the winner of each match to carry forward in the code for use in the next round. I've tried assigning another variable (#define r1w1) and saying that the variable = cName[0] or cName[1] in the if statements like this: (i did this because i thought i could then use r1w1 later in the code)

if(scorea1 > scoreb1) {
printf("
");
printf("WINNER OF ROUND 1 MATCH 1 IS %s
", cName[0]);
cName[0] = r1w1

[Code].....

View 1 Replies View Related

C# :: Program Keeps Adding 1 To Result?

Oct 21, 2014

I am creating a program that allows the user to enter the number of days worked and calculates the amount of money gained by doubling the amount from the previous day, starting with .01 cents. The program works fine except for in day 3, the program adds .01 along with doubling the amount from day 2. Also I must use a List Box.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;

[code]....

View 3 Replies View Related

C++ :: How To Bold Search Result

May 5, 2013

i need to know, that how i can get search result in bold format(using sequential search technique) from an array, in C++ graphic mode ???

e.g.

here is an array : 2 4 5 34 0 -45

and search key == 34

when it found 34 in array, '34' should bold to be prominent.

View 3 Replies View Related

Visual C++ :: Getting CURL Result In MFC?

Sep 27, 2014

I'm trying to messagebox the cURL result:

Code:
CURL *curl;
CURLcode res;
curl = curl_easy_init();

[Code]....

Is there anyway to messagebox the res value ?

View 2 Replies View Related

C :: How To Copy Result Of Printf Into Array

Oct 12, 2013

I am trying to compare 2 strings of characters The users input containing 5 chars is compared to a table If the input is already be existent in the table the index of those chars in the table is printed Quest: how to copy the result of a printf() into an array ? The last printf() gives a sequence of numbers and I am trying to save that sequence to another array for further operation ! I have not been able to do that so far even with tmp[]=i ;

Code:
#include <stdio.h>
#include <string.h>
#define N 30
#define n 100
int main (void)
[code]....

View 2 Replies View Related







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