Posts
 
Reputation
Joined
Last Seen
Ranked #2K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
76% Quality Score
Upvotes Received
9
Posts with Upvotes
9
Upvoting Members
7
Downvotes Received
3
Posts with Downvotes
3
Downvoting Members
3
2 Commented Posts
~24.1K People Reached
Favorite Tags

61 Posted Topics

Member Avatar for teo236

I am writting a simple C++ programm and I want to generate outputs to the console but with the functions 'fwrite' and 'printf'. However, I can't print special characters like 'á', 'é', ... Here is a simple code: printf("Special character: 'ñ'"); Were the output was `±` I found that those …

Member Avatar for tinstaafl
0
361
Member Avatar for yawbiney

That's because not always all the variables are initiated with a value of 0 or NULL. So you must start your code initiating all the variables of your struct as 0 or NULL, or the value that you want. In your case, when you receive an empty input, it will …

Member Avatar for ahmedhamdy
0
2K
Member Avatar for newbie14

I haven't use centos yet, but it seems that it is not the problem. I think that the problem is here: `for(i=0;*email_list[i]>0x0;i++)`. Why are you calling with '*' if you are using '[]'? Try changing that part like this: `for(i=0;email_list[i]>0x0;i++)`.

Member Avatar for newbie14
0
299
Member Avatar for zindgi66

Why don't you use functions to call each node? If you need data that you have aldready use, then why don't you use arrays? Make your code a little bit more readable.

Member Avatar for zindgi66
0
188
Member Avatar for arnabjonty

Use substr to extract the characters before the word, after that use it again to extract the raw of characters after the word, then join both strings by summing them. Example: string sentence="blah blah blah"; string before=sentence.substr(0,5); string after=sentence(10,14); string withoutTheWord=before+after;

Member Avatar for Lucaci Andrew
0
155
Member Avatar for ziadkassam

First of all, is better to use the standard of main as an int returning function, don't use void. Second, you must read [this](http://www.cplusplus.com/reference/cstdlib/rand/), you are not using well the rand function (it is always showing the same numbers). And third, the way you are multiplying the matrix is ok …

Member Avatar for ziadkassam
0
425
Member Avatar for teo236

I'm using Eclipse and I made a program that reads ID3 tags. The problem is that each time I run it, it stops in this line: TagFrame * tmpFrame=new TagFrame(frameID,header.getFilename(),stream); bufferLeft-=tmpFrame->getFrameSize(); tmpFrame->readObject(); frames.push_back(tmpFrame); //This line!!! Where the variable 'frames' is a std::list<TagFrame*>. This block of code is beeing called from …

Member Avatar for teo236
0
233
Member Avatar for thePAkid

The problem is here: for(int i = 0; i < HOME_NUMBERS; i++) { for(int j = 0; j < PRICE; j++)//this loop writes the prices outFile << homeInfo[i][j]; outFile << avgCalc(homeInfo);//This line writes the avgCalc after writing the prices outFile << endl; } First, you are writing the avgCalc after …

Member Avatar for azeem abbas
0
160
Member Avatar for Valiantangel

You are not printing any [type](http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html) in that way. You need to make a function inside IntegerSet that prints each one of the elements from the set. Method `union(IntegerSet setA, IntegerSet setB)` is returning an IntegerSet class, not an integer or a string. You can implement the [toString()](http://www.javapractices.com/topic/TopicAction.do?Id=55) method if …

Member Avatar for JamesCherrill
0
133
Member Avatar for jwings

Adding labels with different background colors to a JFrame is not a good idea (if that's what you did). If you did so, better use [JLayeredPane](http://docs.oracle.com/javase/tutorial/uiswing/components/layeredpane.html) component. You add in it all your components instead of adding them directly to the JFrame. Then you add your labels in a layer …

Member Avatar for JamesCherrill
0
643
Member Avatar for SuperManofBC

you don't have to read a lot to understand a switch statement. It works like this: switch(variable) { case 1: //do something break; case 2: //do something break; case 3: //do something break; //... default://in case it's an unknown case //do something break; } In your case, `break;`'s are not …

Member Avatar for stultuske
0
215
Member Avatar for GeekTool

You can use a switch to replace an if in some cases like when you ask multiple choice questions. Then the answer will be 'a', 'b' or 'c', specific characters that you can switch. Use variables like `char answer;` or `int amount;` so that you could switch them and operate …

Member Avatar for stultuske
0
134
Member Avatar for nathaniscool99

When you do this: `readFile >> temp;` or this: `readFile >> temp1;` you are not reading a line, that operator is reading each character until it reaches a whitespace. If there is no whitespace in your file, it will read the whole file. To read a line you have to …

Member Avatar for adityatandon
0
171
Member Avatar for cool_zephyr

I tried your code and it worked fine on my x86 computer. Maybe there is something wrong with the VC compiler or with the visual studio. Is it an "Empty project"? If not you need to add #include "stdafx.h" at the beginning of the file.

Member Avatar for adityatandon
0
584
Member Avatar for raj874

Try using [EnumWindows](http://msdn.microsoft.com/en-us/library/windows/desktop/ms633497(v=vs.85).aspx) function. It sends you the information from all the current windows. Then you will see if you have a window titled "Windows Task Manager"

Member Avatar for adityatandon
0
123
Member Avatar for hekri

The visual studio offers you the option to create forms. For using them you need to create a new [windows form project](http://msdn.microsoft.com/en-us/library/ms229601). In this kind of project you can add your .cpp and .h files. It offers you the possibility to create windows like drawing them. You add it the …

Member Avatar for hekri
0
199
Member Avatar for tomtetlaw

I found this [website tutorial](http://nehe.gamedev.net/tutorial/playing_avi_files_in_opengl/23001/) in google. It could probably help. There are the codes at the end of the page for all compilers.

Member Avatar for tomtetlaw
0
143
Member Avatar for Interista

A node is a simple struct or class that contains elements and a pointer to the next node like K0ns3rv did with `Node * next`. In this case it's better to use a struct because you don't need to make private your variables, it will be harder if you work …

Member Avatar for corby
0
2K
Member Avatar for MrEARTHSHAcKER

Are you making a window application or it's just a console? If it's a console you can use the C function [getch()](http://www.programmingsimplified.com/c/conio.h/getch) from the <conio.h> library. It gets the input character before it's shown.

Member Avatar for triumphost
0
330
Member Avatar for triumphost

You can't make this work because the thread procedure need to know how many parameters does it have and what kind of parameters. Instead I would try using a va_list ([stdarg.h](http://www.cplusplus.com/reference/clibrary/cstdarg/)), changing the Threading function like this: void Threading(HANDLE &hThread, DWORD &ThreadID, void * FunctionToPass(int,...)) { hThread = CreateThread(NULL, 0, …

Member Avatar for mike_2000_17
0
455
Member Avatar for cookiejarvus

Don't do it like that. It takes too much time and wastes to much memory. Instead of creating an array with every number, try switching the random number generated: [CODE]switch(generatedNumber){ case 1: total1++;//increment the total of number 1 case 2: ... }[/CODE] There are other ways to get the same …

Member Avatar for teo236
0
338
Member Avatar for ThomsonGB

Try searching those errors in google. [URL="http://msdn.microsoft.com/es-es/library/ewcf0002(v=vs.80).aspx"]http://msdn.microsoft.com/es-es/library/ewcf0002(v=vs.80).aspx[/URL] You need the "std" namespace for string and vector. You can either add a line with "using namespace std" or replace "vector" by "std::vector" and so on for each string.

Member Avatar for ThomsonGB
0
506
Member Avatar for arubajam

What's class "student"? You have to add constructor in the class Teacher to construct this class with a Student. In main you can't call class Teacher if you write "teacher"(with a lower case letter). It must be like this: [CODE]/*upper case only for the first one wich is the class*/Teacher …

Member Avatar for arubajam
0
192
Member Avatar for Zssffssz

Why don't you try it yourself? As the name of itself says "Global variables", you can only create variables, as many as your computer can.

Member Avatar for mike_2000_17
0
164
Member Avatar for dgreene1210

I can help you with two errors. FIRST [QUOTE]main.c:11: error: syntax error before '%' token[/QUOTE] When you use fscanf the format must be as a string of characters: between quotes. [CODE]while(y = fscanf(p, %c, &(item.key))!EOF);[/CODE] SECOND [QUOTE]printlist.c:11: error: request for member `data' in something not a structure or union[/QUOTE] If …

Member Avatar for dgreene1210
0
190
Member Avatar for vikjatajy

[QUOTE][CODE]cout<<i<<". "<<m_pBuffer[i]<<endl;//m_pBuffer[i] is a CComplex[/CODE][/QUOTE] CComplex is a class and you can't print it in this case. Maybe you could try printing a value contained in that class.

Member Avatar for teo236
0
189
Member Avatar for jhamill

There is a class [URL="http://docs.oracle.com/javase/tutorial/uiswing/components/label.html"]JLabel[/URL] that you can use to add text. You can hide a JLabel containing the text "YOU WIN" (setVisible(false)) and when the bounds of the image intersect to ones of the cheese, then you can make it visible again (setVisible(true)).

Member Avatar for teo236
0
123
Member Avatar for kyriacos1986

I can't understand exactly what you are trying to do. item1 and item2 are Integer types or classes. You are using templates. That's why it gives you that error. If you are trying to remove element x from a list you have to do it like this: [CODE]list.remove(x);//where x is …

Member Avatar for kyriacos1986
0
442
Member Avatar for jackmaverick1

can you show us an example where your code doesn't work as you thinked? I didn't see any error in this segment of code.

Member Avatar for NormR1
0
322
Member Avatar for terence193

The program isn't skipping any values. ashlock is right, the character '\n' (Enter) is taken as a character in the input of the program. If you still want to use the functions 'scanf' and 'printf' you will have to use a "fflush(stdout)" after calling the funtion printf and a "fflush(stdin)" …

Member Avatar for ashlock
0
98
Member Avatar for cka91405

You need first to read an integer, not a string. You have to use:[CODE]fscanf("%d\n",&i);[/CODE] Then you will need to create an array of characters (string) with the size readed using a pointer([URL="http://www.ics.uci.edu/~dan/class/165/notes/memory.html"]malloc[/URL]). After that you will have to use a 'while' loop: [CODE]while(i>0){ //read character i--; }[/CODE] or if you …

Member Avatar for teo236
0
380
Member Avatar for teo236

hello i'm trying to draw a kind of arrow with an specific thickness. i've already this: [CODE] public void paintComponent(Graphics g){ super.paintIcon(comp, g, width, height); for(int i=0;i<thickness;i++){ Polygon arrow=new Polygon(); arrow.addPoint(7*scale, 0*scale+i); arrow.addPoint(14*scale-i, 9*scale-i); arrow.addPoint(10*scale-i, 9*scale-i); arrow.addPoint(10*scale-i, 29*scale-i); arrow.addPoint(4*scale+i, 29*scale-i); arrow.addPoint(4*scale+i, 9*scale-i); arrow.addPoint(0*scale+i, 9*scale-i); g.drawPolygon(arrow); } g.setColor(Color.BLUE); Polygon arrow=new Polygon(); …

Member Avatar for hfx642
0
128
Member Avatar for teo236

how can I sleep my program without sleeping others (or making them slower)? I am using a windows application. here is a fragment of my code: [CODE] //#includes... int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, char * cmdParam, int cmdShow) { MSG msg; int status; Window myWind(SW_SHOW,"Name",150,120,500,0); for(int i=0;i<550;i++){ myWind.setLocation(i,i); …

Member Avatar for teo236
0
202
Member Avatar for drameshgar1

you can't do this unless your app has a function to run java. then you could try getting a java function for your own program. I recommend you to don't do that because the iphone doesn't support Java. it would run very slow.

Member Avatar for drameshgar1
0
156
Member Avatar for alliswim2010

use: [CODE]double x=0.555; System.out.println(Math.round(x));[/CODE] to round a double easily.

Member Avatar for ~s.o.s~
0
727
Member Avatar for Tom_Weston

you forgot the ';' in: [CODE] ... //HERE - > calc == "calc;" if(calc == "calc") { system("calc"); } else { ... [/CODE] and also you have to include the <stdlib.h> header. without it you can't use "system"

Member Avatar for Tom_Weston
0
85
Member Avatar for Judas3213
Member Avatar for NormR1
0
164
Member Avatar for Superandomness

you can use the C method [URL="http://www.cplusplus.com/reference/clibrary/cstdio/scanf/"]scanf[/URL]. so you can read a number followed by a character followed by another number. You can´t read an operator, it would be like reading a function, impossible.

Member Avatar for Superandomness
0
176
Member Avatar for ChunkyGerbil

check this: [URL="http://www.devdaily.com/blog/post/java/remove-non-alphanumeric-characters-java-string"]http://www.devdaily.com/blog/post/java/remove-non-alphanumeric-characters-java-string[/URL]

Member Avatar for teo236
0
132
Member Avatar for coolbeanbob

That's because your code is wrong. rand() function always include 0: [CODE]int value = rand() % (range + 1);[/CODE]

Member Avatar for Fbody
0
176
Member Avatar for werdna347

you have to use a do-while or while loop in this case. You could try: [CODE]while(true){ cout... cin... switch() { case ... default: cout<<endl<<"Incorrect";continue; } break; }[/CODE]

Member Avatar for Cross213
0
289
Member Avatar for senergy

Here is a tutorial of mysql: [URL="http://dev.mysql.com/doc/refman/5.1/en/connector-cpp-tutorials.html"]http://dev.mysql.com/doc/refman/5.1/en/connector-cpp-tutorials.html[/URL]

Member Avatar for Ancient Dragon
0
327
Member Avatar for g33k3r

In this website we won't solve all your problems by pasting a piece of code. If you have problems with your arrays you could try to use an ArrayList instead of simple arrays. An ArrayList is a linked list (kind of array) which is used to add elements and remove …

Member Avatar for NormR1
0
117
Member Avatar for Xoltha

In option A you have to initiate your var 'c' like this: [CODE]char * c=new char[length];[/CODE] That's why it gives you an error. It's a [URL="http://www.cplusplus.com/doc/tutorial/dynamic/"]pointer[/URL].

Member Avatar for teo236
0
175
Member Avatar for dilequeno

your code isn't wrong but the size of the array is too big. Your are creating a 100*100*100 sized array. if you try with a slower array it will work.

Member Avatar for Salem
0
429
Member Avatar for quinnifir

you don't use the for loop like that. the condition must be f<20. it works like a while. The while is the opposite of an if. That's why you're getting zeros, your int array has never been initialized.

Member Avatar for quinnifir
0
129
Member Avatar for reemhatim

have you tried to use [CODE] ImageIcon bug1=new ImageIcon("20072011001.jpeg"); ImageIcon bug2=new ImageIcon("20072011002.jpeg");[/CODE] ?

Member Avatar for reemhatim
0
158
Member Avatar for hamzamuradkhanh

java can't read Javascripts. The code that is showing you the program is a javascript.

Member Avatar for teo236
0
182
Member Avatar for DarkPyros

you could use toupper() but also you could try an if statement: [CODE]if(ch is between 'a' and 'z') ch+=('A'-'a');[/CODE]

Member Avatar for DarkPyros
0
183
Member Avatar for Riteman

The End.