C/C++ :: Output Of Program Shows Unknown Character When It Run

Mar 20, 2014

#include <iostream.h>
#include <conio.h>
#include <stdlib.h>
float CalcPriceMember1(int,float&,int&);
float CalcPriceMember2(int,float&,int&);
float CalcPriceNonMember1(int,float&,int&);
float CalcPriceNonMember2(int,float&,int&);

[code].....

View 8 Replies


ADVERTISEMENT

C :: Shows Lines Of Running In Output With Gdb Without Stopping

Feb 24, 2013

I run the program with gdb , i searched but find nothing about how i could run gdb , that shows what line of code is running constantly (i rather it also shows value of the variable on each line if it's possible ) without stopping (i mean i don't want to enter "step" every time , i just need to run the program with debugger and shows line of the code is running (without need to enter step each time by myself)is it possible? if yes , what command is needed to start gdb for this purpose?

P.S: for this purpose if i have to set breakpint i will. but even i rather not set breakpoint , i rather gdb while running the program shows what line is now executing (rather with the value of variabels).

View 4 Replies View Related

C/C++ :: Program To Find Index Of Character In A String Gives Incorrect Output

Oct 28, 2014

I've been typed out a C program to let the user define the size of their string , and key in characters for this string , the program would then prompt the user for a character to search for in the string and return it's index value. Eg. Index of c in abc is 2. My code is as shown:

#include<stdio.h>
#define SIZE 20
int search(char x[SIZE+1] , int n , char s);
int main(void){
char x[SIZE+1] , s;
int n , index;

[Code] ....

However , after I key in my characters for the string , the program does not prompt me to input a character to look for, it just prints it out and returns some funny number. But the program works just fine is I move this portion to the top :

printf("Enter alphabet to find: ");
scanf("%c",&s);

View 1 Replies View Related

C++ :: Program To Create A Dialog Box And Shows It To User

Dec 20, 2014

I want to make a programs which creates a dialog box and shows it to the user. The dialog box should not be pre-loaded, here's an example:

cout << "Button a"
cin >> a
cout << "Button b"
cin >> b
cout << "Button c"
cin >> c

[Code] .....

Each button should be under the other. How can I do this in a C++ project?

View 1 Replies View Related

C/C++ :: Program That Shows All Students Enrolled In Certain Courses

Feb 20, 2014

I'm working on a program that shows all the students enrolled in certain courses.

This is what the correct solution is supposed to output:

enrollmentReport.exe sections0.dat enrollment0.dat

Undergraduate enrollments: 1
Graduate Enrollments: 3

CS 355
23272:Line, S.: 1 students
Squyres, Kristen

CS 571
22000:Caro, Virgil: 2 students
Arnold, Hayley
Aiken, Roberto

22002:Caro, Virgil: 2 students
Belur, Shirley
Aiken, Roberto

This is the output I get:

Undergraduate enrollments: 0
Graduate Enrollments: 0

CS 355
CS 571

I've included all the source code in an attachment. The trick is that I can only modify the section.h and section.cpp

 course.zip (523.39K)

View 5 Replies View Related

C++ :: Passing Unknown Arguments To Unknown Function

May 1, 2013

So I'm making setTimeout and setInterval functions.

I have this remember function (that is part of Timing class) which takes a function pointer and a void pointer, which are remembered in that object.

Another (timing) function of that object is called in every loop of the program and when specific time passes that function calls the remembered function whit the remembered void pointer as argument.

The problem is that the functions that need to be called require unknown multiple parameters, so what I need to do is make a new class that will store the needed arguments. I make the function that needs to be called and that storage object and pass pointers to them to my remember function, when the remembered function is called it stores the data from storage object in new variables and dose it's thing.

View 3 Replies View Related

C++ :: Program Which Reads TIFF Files And Shows Header

Dec 13, 2013

I have program which reads tiff files, and shows header.

Code:

#include <iostream>
#include <fstream>
using namespace std;
#define II 1
#define MM 2
typedef struct {
short unsigned byte_order;

[Code] ....

but I have a problem, my program doesn't shows:

ImageWidth
ImageLength
XResolution
YResolution

I must do this, without using another library like libtiff...

View 1 Replies View Related

C++ :: How To Make A Program That Opens Unknown Files Extensions

Apr 6, 2013

Okay, so I think I have just passed the intermediate line in my skill of c++ and my question is how do I make a program that opens unknown files extensions. for example like .plr. Because I see a bunch of files for game modifications like that, that was a good reason I started c++ too.

View 4 Replies View Related

C++ :: Output Last Character In C-String

Jun 9, 2013

I keep getting this error after I input:

Code:
Unhandled exception at 0x54AE350B (msvcp110d.dll) in Random.exe: 0xC0000005: Access violation writing location 0x0131CA21.

Code:
#include <iostream>
#include <cstring>
//Prototypes
void lastChar(char *);
int main() {
const int LENGTH = 21;

[Code] ....

It builds without any errors. I am just trying to output the last character in the C-string. Am I doing this all wrong?

View 14 Replies View Related

C :: Find Character Position - Output 0

Jul 8, 2014

I try to find charecter position but evey time i run my program it give me 0 position why ? Why in my getChar function give me warning statement with no effect i can not understand this warning where is my mistake.

Code:
void getChar(const char* str){
int lenStr = strlen(str);
int i = 0;
int posCharecter = 0;
printf(" %s has %d charecters length
",str,lenStr);

[Code] .....

View 2 Replies View Related

C/C++ :: Creating Program That Allows User To Enter Unknown Number Of Income / Expense Amounts

Feb 21, 2014

I'm trying to create a program that allows the user to enter an unknown number of income and expense amounts. The program has to us see a while loop and display the income total, expense total, and total profit or loss. I've got it really close, but I'm doing the loop wrong. It counts the sentinel value (-1) towards the total, instead of just ending like it is supposed to.

#include <iostream>
using namespace std;
int main() {
//declare variables
double incomeInput;
double expenseInput;
double incomeTotal=0;
double expenseTotal=0;

[code]....

View 5 Replies View Related

C++ :: Output Unicode Number If Extract A Character Off A Console Or Out Of A File

Oct 31, 2014

How do I output a Unicode number if I extract a character off a console or out of a file.

If I do the below, I use the Unicode number to show a character. The below shows me 25² .

char b = 'u00B2';
mystring = "25";
mystring.append(1,b);

How do you go back the other way? If I extract the 25 and the ² separately, how do I get the unicode number for ² ?

View 3 Replies View Related

C :: Reading In Character In Program

Sep 10, 2014

I just took up c programming and like it so far. Now I got a problem reading in a character in a program. The program looks like this:

insert
Code:

#include <stdio.h>
main()
{
char c1, c2;
printf("Letter 1: ");
c1 = getchar();

[Code]....

View 8 Replies View Related

C++ :: Array Of Char - Shows More Than It Should

Nov 9, 2013

I have this code:

#include <iostream>
#include <string.h>
#include <fstream>
using namespace std;
ifstream f("input.txt");
ofstream g("output.txt");

[Code] .....

This program make a copy of the source array, then it removes each character and shows the obtained array.

And when i insert "abcdefghijkl"

it should show this: "

#include <iostream>
#include <string.h>
#include <fstream>
using namespace std;
ifstream f("input.txt");
ofstream g("output.txt");

[Code] .....

View 1 Replies View Related

C :: Simple Character Counting Program

Dec 14, 2013

Code:
#include <stdio.h>
int main(){
double nc;
for (nc = 0; getchar() != EOF; ++nc)
;
printf("%.0f
", nc);
}

It works well and I am using ctrl-D as my EOF. Now I understand that C is not really a language for dealing with text, which is why I am learning it more in depth, my degree was in robotics, and I think C is definitely the best place to be for me. So this may just be a quirk, but if I type more than 10 characters, I get the right answer from the program, however, if I type less than 10, for the sake of argument I type Hello and then return, if I at that point do ctrl-D, I get the answer 6D?

The 6 is right 5 letters and a return character, but what is the D?

View 2 Replies View Related

C++ :: STL Functions Shows Segmentation Fault?

Sep 1, 2014

I wrote one application using STL API's [vector,map,make_pair,pair]. Application is working fine in Windows 2008 server.

Same application failed in Windows Server 2012 R2 and the failure is randomly occurred.[once in 10 iteration]
I suspect some of my PC update is the root cause for this random failure.

I would like to know which is latest STL version for Windows 2012 R2 server. Is there any latest patch/update released by Microsoft?

Does it good idea to use Boost lib for the same? Which is the Boost lib version for Windows Server 2012 R2.

There is no compilation issue on Server 2008/Server 2012 R2 server.

View 9 Replies View Related

C++ :: Write Program That Ask His Or Her Name And Store It In Character Array

May 28, 2013

write a program that ask his or her name and store it in a character array

View 1 Replies View Related

C++ :: Read TIFF File And Shows Header

Dec 13, 2013

I have program which reads tiff files, and shows header.

#include <iostream>
#include <fstream>
using namespace std;
#define II 1
#define MM 2

[Code] .....

But I have a problem, my program doesn't shows:

ImageWidth
ImageLength
XResolution
YResolution

I must do this, without using another library like libtiff...

View 1 Replies View Related

C++ :: Function That Shows Elapsed Time In Seconds And Minutes

Mar 13, 2013

I am looking for a function or any example that shows elapsed time in seconds and minutes. I didn't find any solution for both OS Win and Linux. I am looking for example that works for both - win and linux.

View 14 Replies View Related

C++ :: Minion Class - When Enter Monster Position App Shows Nothing

Jan 19, 2015

#include <iostream>
using namespace std;
class minion {
minion();
~minion();
public:
int monsterPosition = 50;

[Code] ....

When I enter the monster position . The app shows nothing

View 8 Replies View Related

C++ :: Strings - How To Count Each Number Of Letters And Frequency It Shows

Apr 10, 2014

I try to use "rand" to create 100 string, I'm happy I succeed, but next step i wanna know how to count each number of letters and the frequency it shows.

Here is the code:

#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <iostream>
// using namespace std;
int main() {
const char *c = "abcdefghijklmnopqrstuvwxyz";

[Code] ......

View 1 Replies View Related

C/C++ :: Counting Specific Amount Of Times A Number Shows Up

Apr 11, 2015

Ok, so I am writing this program with 10 different functions, and one of those functions needs to count how many times 0 appears in a text file. I've done this before, but I am so stumped right now. Should I get the numbers from the 2d array I have, or should I just use the text file here? Here is what I have right now:

int toursMissed(int scores[][COLS]){
int counter;
for(counter=0;counter<=96;counter++){
if(scores==0){
counter++;
return counter;
}
}

View 7 Replies View Related

C++ :: Function That Makes Shows Time Entered In Clock Format

Mar 11, 2014

Program should continually have user enter a positive integer, and quits on zero entered. This entered number represents the total number of seconds and after each number is entered a function is called that displays the time in hours, minutes and seconds. Sample output is as follows:

Enter Total Seconds --> 3605 1:00:05

The function needs only one value parameter and should return nothing back to main. If the minutes or seconds are a one digit number then make sure to display a leading zero as the example above shows.

Here is my program. my question is how do i make the numbers appear like this? 1:00:05

#include <iostream>
#include <iomanip>
using namespace std;

[Code].....

View 6 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++ :: Reading Data Character By Character From Text File

Jul 25, 2012

Double values are stored in text file. 23.5 36.8 34.2 ... My teacher told me to read them character by character and then make words, like i have to read "2" "3" "." "5" and now have to make it or treat it as word and then using atoi(). I have to convert it into double. but i dont know how to do this....

View 5 Replies View Related

C :: Program To Accept Only Numerical Values And Gives Error If Character Or Symbol Entered

Nov 11, 2013

How can i make my program to accept only numerical values and gives a error notice if a character or a symbol is entered???

View 4 Replies View Related







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