- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 4
- Posts with Upvotes
- 4
- Upvoting Members
- 4
- Downvotes Received
- 26
- Posts with Downvotes
- 16
- Downvoting Members
- 14
86 Posted Topics
![]() | Re: Your code is not formatted. [QUOTE]Wrong int k=100; Correct int k = 100[/QUOTE] [CODE]#include<stdio.h> int main() { int pcheck = 1,i; int k = 1000 for(i = 2;i < k;i++) { if((k % i) == 0) { pcheck = 0; break; } } if(pcheck) { printf("%d is a prime .\n",k); … |
Re: At least write something useful. How does it failed? How can we helped you? | |
Re: Why are you using float? Line 6 and 27. Use int instead of float. | |
Re: This is an example. [CODE]#define randomize(srand)(time(NULL)) #define random(num)(rand() % (num)) #define max(x,y)((x) > (y) ?(x) : (y)) #define red 12[/CODE] | |
| |
What is the difference between using system("pause") and cin.get(pause)? [URL="http://www.daniweb.com/forums/post1446085.html#post1446085"]Oliver [/URL]told me never use system("pause"). [code] #include<string> #include<iostream> int main(){ using namespace std; string str = "My name is shridhar"; cout<<"What is your name"<<str; char pause = 0; cout << "Press enter to continue..."; cin.get(pause); } [/code] | |
Re: Your code is not formatted.[URL="http://www.gidnetwork.com/b-38.html"]Formatting[/URL]. | |
Re: Your code is not [URL="http://www.gidnetwork.com/b-38.html"]formatted[/URL]. | |
Re: First, your code is not formatted. [url]http://www.gidnetwork.com/b-38.html[/url] [QUOTE]but i get a warning and an error.[/QUOTE] How does it failed? What type of error did you get? | |
Re: First use code tags. Your code is not [URL="http://www.gidnetwork.com/b-38.html"]Formatted[/URL]. [CODE]#define print_int(a) printf("%s : %d\n",#a,(a)) int y = 10; print_int(y)[/CODE] | |
Re: How does it failed? What are you trying to draw? How can we help you? | |
Re: First your code is not formatted. Explain yourself. How does it failed? | |
Re: First use code tags. [CODE]#include <stdio.h> /* printf, scanf,definitions*/ #define KG_PER_POUND .4536 /*conversion constant */ int main(void) { double pounds, kg; /* Get the weight in pounds. */ printf("Enter the weight in pounds> "); scanf("%lf", £s); /* Convert the weight to kilograms. */ kg = KG_PER_POUND * pounds; /* Display … | |
Re: Your code is not formatted. [url]http://www.gidnetwork.com/b-38.html[/url] Format your code and then we will help you. | |
Re: First use code tags. [CODE]#include <iostream> #include <fstream> #include <cstdlib> using namespace std; int main () { char filename[50]; ifstream balwin; cin.getline(filename, 50); balwin.open(filename); if(!balwin.is_open ()) { cout << "doesnt found" << endl; exit (EXIT_FAILURE); } char word[50]; balwin >> word; while(balwin.good()) { cout << word << " "; balwin … | |
Re: First use code tags. [CODE]#include<conio.h> #include<string.h> #include<iostream.h> void main() { string str = "My name is shridhar"; cout<<"What is your name"<<str; getch(); }[/CODE] | |
Re: POst your code and we will help you. | |
Re: First use code tags. [CODE]int main() { char *pointer = "hi"; pointer = "weeeeeeeeeeeeeeeeeeeeeee"; return 0; } [/CODE] | |
Re: This is an example. [CODE] #include <string> void color(){ cout << "write a number" << endl; string color; cin >> color; system( ("color "+color).c_str() ); }[/CODE] ![]() | |
I need to calculate the area of a triangle using this formula. What is wrong with my code? error C2063: 'p' : not a function [CODE]#include <stdio.h> void Area(int a, int b, int c) { int p = a * b * c; int area = (p(p - a)(p - … | |
![]() | Re: Your code is not formatted. Format your code and then we will help you.[url]http://www.gidnetwork.com/b-38.html[/url] |
I am trying to print a rectangle using this symbol *. When I print it, it draws an L. What is wrong with my code? [CODE]#include <stdio.h> void rect(int base, int height) { int x = 0,y = 0; while(x < height) { x++; if(x == 1 || x == … | |
Re: Your code is not [URL="http://www.gidnetwork.com/b-38.html"]formatted[/URL]. | |
Re: Post all your mistakes. Maybe we can help. | |
Re: [URL="http://www.mycplus.com/featured-arti...in-c-language/"]This [/URL]might help. | |
Re: Your code is not [URL="http://www.gidnetwork.com/b-38.html"]formatted[/URL]. Delete extra blank lines Line 3. Is that a comment or a mistake? | |
Re: This might help. [CODE] int max(int a, int b){ return a>b ? a:b; } int min(int a, int b){ return a<b ? a:b; }[/CODE] Upvote my post if they helped. | |
Re: First use code tags. [CODE]Class Flights { public: Flights *FL; ....... ....... void function() // use a non constructor function for this { FL=new Flights[150]; ........ } ........ }; [/CODE] | |
Re: First, use code tags. [CODE]#include <iostream.h> | #include <iostream.h> #include "a3.h" | #include "a3.h" using namespace B; | using namespace B; | int main() { | int main() { Date d1(26,3,1999),d2; | Date d1(1,1,2000); | d1.print_nz(); | d1.print_nz(); cout << endl; | cout << endl; d2 = d1 + 6; … | |
Re: Line 162. [CODE] sorted_graphic(int distance_array[],int num) { }[/CODE] | |
Re: Post your code. Maybe we can help. | |
Re: Foo is an undefined variable. Use other words instead of foo or FOO. | |
I cannot copy 2d array. There are no errors in my error list. What is wrong with my code? The problem might be located in create(). Thanks in advance. Here is my code. [CODE]int **map void randomize(int numberToSelect,int range, int *list){ int* remainingNumbers = new int[range]; int* chosenNumbers = new … | |
Re: [URL="http://www.morearty.com/code/breakpoint/"]This [/URL]might help. upvote my post if they helped. | |
Re: We are not here to do your homework. Post all your code and maybe we can help. | |
I cannot copy random numbers without repeating in a map. Unhandled exception at 0x0040115e in file.exe: 0xC0000005: Access violation writing location 0xabababaf. [CODE]int **map; int randomize(int numberToSelect,int range,int counter){ int* remainingNumbers = new int[range]; int* chosenNumbers = new int[numberToSelect]; for(int i = 0; i < range; i++) remainingNumbers[i] = i; … | |
Re: Post all your code. Maybe we can help. | |
Re: Your code is not formatted. Delete line 6. Write conio.h innstead of conio. | |
Re: Line 14. [CODE]else if( name == bro's name );[/CODE] | |
Re: [CODE]void color(){ cout << "write a number" << endl; string color; cin >> color; system( ("color "+color).c_str() ); }[/CODE] | |
Re: Use code tags. [CODE]#include <string> You can assign value by, int main() { string name; name = "This is a string. Don't forget to use double quotes instead of single!"; cout << name; }[/CODE] | |
Re: First use code Tags. [CODE]public static FileInputStream readAsFileInputStream(String fileName,String fileLocation) throws IOException { FileInputStream fileinputstream = null; File file = null; try { file = new File(fileLocation,fileName); fileinputstream = new FileInputStream(file); } catch(IOException ex) { ex.printStackTrace(); } finally { fileinputstream.close(); } return fileinputstream; }[/CODE] | |
Re: It is impossible. Some words are used to get a letter (number). cin and get are examples. | |
Re: Line 25,26 and 27. Just write [CODE]cout << endl << "Your attacks:" << endl << endl;[/CODE] | |
I need help with rand();. This program produces random number without repeating. In my error list there are no errors. Unhandled exception at 0x00414742 c++.exe: 0xC0000094: Integer division by zero. [CODE]int *numbers,range; void randomize(unsigned numberToSelect){ for(unsigned i = 0; i < numberToSelect; i++){ const int selectedElement = rand()%(range - i); … | |
Re: [URL="http://www.cplusplus.com/forum/general/8896/"]This [/URL]might help. UPVOTE MY POSTS IF THEY HELPED YOU | |
How can I change the file properties in c++? I would like to write in the file properties the author and time. |
The End.