- Strength to Increase Rep
- +8
- Strength to Decrease Rep
- -2
- Upvotes Received
- 17
- Posts with Upvotes
- 15
- Upvoting Members
- 12
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
I am having problems using the square root function in my program. I have included <cmath> outside of main and my formula using the square root looks like this: area=sqrt(s*(s-a)*(s-b)*(s-c)); but, I keep getting an error that says 'sqrt' cannot be used as a function. I would appreciate any suggestions. … |
|
hello... I am trying to convert 2 digit numbers to words: example 11= eleven. I saw some other entries on this but they dont include case or switch so far I have: [code=cplusplus] #include <iostream> using namespace std; cout<<"Enter a two-digit number: "; cin>>number; if(number>99) { cout<<"Number out of range"; … |
|
I'm doing a program on a quiz using DEV C++ and i want to set a countdown timer for it. As the user is doing the quiz, he's able to see the timer and once the timer reaches 0, the quiz automatically stops. Is it possible to do this? Thanks … |
|
can you call a function inside that same function so that it goes to the beginning of that code to execute it. So even though ur already in the prompt function can u still call it again from withing the code inside the prompt function. Thanks in advance. |
|
Just need help with regards to this part, i'm meant to use scanf() to read a string from keyboard and return number of characters read, so i'm supposed to read a character string. The scan must then terminate at whitespace. A null character is stored at the end of the … |
|
hello. I'm doing a program in c++ and I need to use a system call to "clear" my screen. for linux I use system("clear") but in windows the same is system("clr"). is there some way to find which OS is being used at the moment of execution so the program … |
|
Please help to make a code of the josephus problem in C using the circular linked list. |
|
[CODE] #include<stdio.h> #define MAX 4 main() { float A[MAX]; int i; for(i=0;i<MAX;i++) scanf("%f",&A[i]); return 0; } [/CODE] im using Visual C++ and doesnt give me any compilation error it keeps giving me a run time error after i enter the 1st number i can't figure out whats wrong :S help? |
|
What does this error mean? invalid operands of types `float[20]' and `float[20]' to binary `operator+' I can't use the + operator when adding array elements? This is my code lines, I'm just trying to add the four surrounding values in a [20][20] array of numbers to the element that's in … |
|
Ok, my problem is that I'm reading from a file 3 values, a last name, first name and salary, for example: Key Bobby 43000 I have an array of objects for each person, so I neeed to read this file and assign the last name, first name, and salary to … |
|
Hello everybody, I'm hatem faheem a student in Cairo university , Faculty of Engineering , Computer departement I have a question in the C++ string class constructor <string> that's the code [CODE] #include <iostream> #include <string> using namespace std; int main() { string s0 ("Initial"); string s1 (s0,3); string s2 … |
|
currently i am writing a text based RPG but, when i call for the fight my rand() either does not seed each time or it glitches to continuously gets the "Boar". if you could please take a look at it and see if the problem is in the coding, i … |
|
Hello. I've just started learning Python and I have a few questions. I'm using my program to communicate with some device through serial port using serial.py library. It's all going really fine. I've got a class device, and I'm using it to communicate with a device (logical ;) ). Q: … |
|
I've been trying to read characters from the keyboard using 'getchar()' but my code always misses one character. Can anyone tell me why this is [CODE=suntax]#include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char *argv[]) { char string[50]; int i; printf("Enter a string: "); for (i=0; i < strlen(string); … |
|
Hello, The Hexadecimal value of EBCDIC has to be converted to corresponding character as the user inputs it. The following table shows the hexadecimal value of characters in ASCII and EBCDIC. Can anybody help me with an efficient C-Algorithm for this conversion? Char----Deci-------Hex.ASCII---Hex.EBCDIC A ------65---------41------------- C1 B-------66---------42-------------C2 C-------67---------43-------------C3 D-------68 ---------44-------------C4 … |
|
strunct num { int count; }; void main() { num n1; num *p; p=# scanf("%d", p->count); printf("%d", p->count); } when I attempting to do this one I got the error message like 0 Null pointer ..... |
|
I'm writing a program that can lock the keyboard. I patch into ISR 9(the keyboard interrupt) and manipulate the head and tai pointers. It work fine , but there're something I don't understand: -It seems that I cannot use int 21h when patching into an interrupt -When I run my … |
|
Hi, I have these errors: --------------------Configuration: IP_devllink_06 - Win32 Debug-------------------- Linking... IP_devlink_06.obj : error LNK2001: unresolved external symbol _DLClose@4 IP_devlink_06.obj : error LNK2001: unresolved external symbol _DLOpen@24 Debug/IP_devllink_06.exe : fatal error LNK1120: 2 unresolved externals Error executing link.exe. IP_devllink_06.exe - 3 error(s), 0 warning(s) The probloem is that I am … |
|
Write a program that will prompt the user to type in a series of characters. Input these characters into a c-string (char array). For each character, if it is a letter, toggle the case (upper to lower case, or lower to upper case). All other characters leave as is. Print … |
|
Hi all, Just a simple question. How do i reverse a pointer to a set of values given that i know the size of the pointer? Eg int *temp = malloc(ptr_size); // values of *ptr let say is 1......100, // if i use the algorithm below, it gets me 1..50...1 … |
|
[CODE]std::string s="s1"; std::cout<<s<<std::endl; { std::string s="s2"; std::cout<<s<<std::endl; };[/CODE] Why can I have two variables with the same name existing like this? |
|
Hi everyone, basically i'm writing a simple program in c++ to trigger a beep from the internal speaker much like a musical keyboard except i'm having trouble with capturing key press how would i be able to trap a key press then initiate a beep, i have tried using kbhit() … |
|
Hi guys, right now I am an amateur in the world of programming and am starting to "train" myself by thinking of ideas for a program and figuring out how to write it. So right now, my first real undertaking I have devised is to write an itemizer where the … |
|
When i compile my code i keep getting an error. *** glibc detected *** ./main: free(): invalid pointer: 0xbfb82c34 *** . I can not figure out for the life of me what the issue is. I think it may have something to do with my constructor. Any suggestions would be … |
|
Without using MUL, IMUL, DIV, IDIV instructions and any iteration, find the product of 25 and a value in BL. save your result in DL . this is a task which i need some help in .. because i cant seem to figure how can we multiply without any iteration … |
|
hey guys i am using miracle c compiler on windows xp.... i am trying to figure out how does pointer to functions work..... i have gone thru many tutorials but all have them failed to compile.... [code] #include <stdio.h> int sum(int x, int y) { return x + y; } … |
|
Hello.. This is what my program is suppose to do: -find length of list -check for empty list -insert in back of list -delete from front of list [B]I have everything done except finding the length of list and check for empty list.[/B] I need help getting the length of … |
|
Hi! I have the following code: [CODE=asm] mov al, 5d neg al[/CODE] When it executes, CF = SF = AF = 1 Ok, I think I understand why AF (number is bigger than 00001111b ?), SF (most significant bit is now 1 not 0) But what I don't understand is … |
|
How can I allocate a 2D array? (on the heap) It needs to be dynamically allocated because the values of rows and columns aren't known. |
|
Hello to all of you! I would really appreciate somebody telling me complete step by step tutorial how to work with MASM (or TASM, but I haven't noticed it's free to download) I've tried myself MASM and TASM (some Telemark assembly, not Borland), but for some reason it won't work, … |