- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 4
- Posts with Upvotes
- 4
- Upvoting Members
- 3
- Downvotes Received
- 4
- Posts with Downvotes
- 4
- Downvoting Members
- 4
72 Posted Topics
[CODE=C++] ... void selsort(int AR[],int size) { int small,pos,tmp,i; for(int i=0;i<size;i++) { .... [/CODE] if you declared i before, you don't need to do it in the loop. [CODE=C++] ... void selsort(int AR[],int size) { int small,pos,tmp; for(int i=0;i<size;i++) { ... [/CODE] Hope You'll find this information helpful.
[QUOTE=kashmir323;509106]Is there a C++ command that restarts the application. The program I'm making is just a console application that acts like a calculator. But once you enter your number and press enter you have to close the console and re-open it to find another number. [CODE] int yes = ; …
Have you put [CODE=C++] template <class T> class Image { }; [/CODE] And where is Image.hpp?
I wrote you code on Visual C++ 6.0 and it works. Use this Compiler ))
Really it is doing with int 21h in MS-DOS. I don't know how right now but if you want I'll review asap.
[QUOTE=gcardonav;529897]Hello guys You rookie here. been trying to run a code but I am getting this weird error that I have not seen before. I have attached a copy of the error and the part of the code it refers to. Thanks for your help GCard [inlinecode]1>------ Build started: Project: …
[code=C++] #include<stdio.h> #include<conio.h> int main(void) { int row=0,col=0,sp=0,b,mid=1,st=71,end=64; //clrscr(); int column_num=0; for (row=1;row<=7;row++) { for(col=65;col<=st;col++) { printf("%c ",col); } for(b=1;b<mid;b++) { printf(" "); } for(sp=70;sp>end;sp--) { printf("%c ",sp-column_num);//start with less symbol } st--; mid+=2; column_num++; end++; printf("\n\n"); } getche(); return 1; } [/code] Your code is absolutely unreadable but I …
Standart solution is stack. Continue?
I see that the problem is little but the code is huge and unrecognisable....
Maybe Lenght+1? What compiler system do you use?
I think that you should try to put template<class TYPE> before EVERY function which is uses TYPE. KTYPE analogical.
Have an idea that you have not included headers. Maybe you typed class name incorrectly.
No capital letter in void: [CODE=C++] void powerArgs(int *parmA, int *parmB) { int temp = *parmA; *parmA = *parmB; *parmB = temp; } [/CODE]
[QUOTE=cosmos22;552066]Hi. (I am using Windows XP) I would like to know how you can use the function SetFileAttributes to hide a file or folder, I would also like to know about the declarations associated with this function. I would like to use this to develop a program that hides program …
Maybe you should set a type to parmA & parmB: [CODE=C++] void divideArgs(int *parmA, int *parmB){ int temp = *parmA; *parmA = *parmB; *parmB = temp; } [/CODE]
[CODE=C++]int *temp = *parmA; *parmA = *parmB; *parmB = temp; [/CODE] Forget pointer with temp.
Try: [CODE=C]for (x = integer1;integer1 < integer2;integer1++); { sum += integer1; } [/CODE] You should add numbers to sum, so take a sheet of papper and look what you are doing.
Look for this [CODE=C] Individual **temp_; temp_=(Individual **)malloc(sizeof(Individual)*5); [/CODE] malloc return a pointer, not double pointer. So you must do memmory allocation in the loop. Better to use C++.(I think)
You should anything about how to wrogramming matrixes. WaltP is right, we don't write programmes for nothing.
Post what you have done. Do you even know how to write programmes?
[QUOTE=sfurlow2;546616]I have another question for my homework. Here is the problem: Keep inputting numbers from the user until the user enters a 0. After each number, print a "running average". That is, print the average of the last three numbers entered. Be careful how you handle the first two numbers …
It is very big mistake to write [CODE=C++]printf(c);[/CODE] Correct is [CODE=C++]printf("%c", c);[/CODE]. Remember the definition: [CODE=C++]printf(argument, ...);[/CODE]
There are a lot of syntax errors in your code. You forget to put ' ; '. case77 is not correct to. Maybe ou want case 77 (with space). The last is that you use goto and it is very bad style so I can't look for running your code.
[QUOTE=jessel;546417]hello sir i'm a new user,i just want to ask if you have sample programs which deals on linked list....if possible not the add.edit,delete program[/QUOTE] Here is a simple one. I can't write without classes, anyway. [CODE=С++] #include <iostream> struct listelem { char data;//any type here listelem* next; }; class …
You are posting your code twice. With wich I should work?(interesting)
You thing that for (x = 0; x < 2000000000; x++) will work quickly??? Mad boy. If you start this loop without any operations it will be VERY long....
Post what you have done and we will see and correct. I won't do your homework.
You must call switch in some fucntion, it is an operator not a function. E.g. [CODE=C++] int foo(char c) { switch(c){ case 'B':return 0;break; case 'N':return 1;break; case 'R':return 2;break; case 'O':return 3;break; case 'Y':return 4;break; case 'G':return 5;break; case 'E':return 6;break; case 'V':return 7;break; case 'A':return 8;break; case 'W':return …
[QUOTE=hyperzero4;536378]Hello, I'm very, very new to C++ and I'm taking computer science course right now for fun. I really want to learn C++ but I'm having a lot of trouble with this new homework assignment and I'm hoping I just take it one step at a time so I completely …
Type in the end of main [CODE=C++]cout<<val;[/CODE] If it doesn't help use getch() from conio.h
[QUOTE=kabbo;536267]Hi, i am trying to use a library. included the header in my code set the path (-L) and the library (-l), but i get the following error and a bunch of undefined symbols. Does anyone have an idea? What am i doing wrong? Thans in advance. PB:~/Downloads/lp_solve_5.5.0.11_c max$ gcc …
Say the type of your image file. Then we will talk...
You might use some special libraries. Tell what you programme looks like?
You really need to put [COLOR="Red"]break[/COLOR] after each case implementation.
If you do just simple equals and smth like that just do [CODE=C++] char c; int i; i = int(c); [/CODE]
I correct your VERY simple syntax mistake. Here is correct code: [code] #include <iostream> #include "point.h" using namespace std; void rotate(point &p); int main() { a.point(0,0); cout << "(" << a.get_x() << ", " << a.get_y() << ")\n"; a.shift(2, -1); cout << "(" << a.get_x() << ", " << a.get_y() …
There is no way to mix .lib and .dll files between different platforms and compilers.
1) give some of your thoughts; 2) see the reading of the file and list working manuals
There are a lot of pointers in your code. Try to debug them.
You really think that we can read this code without comments?
Try to do it so you'll se is it valid or not. No ideas (
Really I don't understand th problem. Try to explain one more.
One more function(win platform only): [CODE=C] #include <windows.h> ... WinExec(filename, SW_SHOW); [/CODE]
[QUOTE=sn_sundeep;516693]Hi, Is there any way so that I call mspaint through my C program and edit the resolution or resize my photos? Sundeep[/QUOTE] Call mspaint: [CODE=C++] WinExec("mspaint.exe", SW_SHOW); [/CODE] MsPaint uses standart Windows GDI function for working with images. Look through MSDN.
Type some code.
The End.