188 Posted Topics

Member Avatar for bh_hensem

[QUOTE=bh_hensem;249154]Hi, Actually my program will be read some input, as example :- 123=saya 456=ada 132=buku 321=cerita So, I would like to copy all the data into array or whatever and print it at the end of my program. Could some body help me ?[/QUOTE] Don't understand. The user must enter …

Member Avatar for Salem
0
102
Member Avatar for vbcielle

First of all [inlinecode]fflush(stdin);[/inlinecode]won't do the work! Read [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1044873249&id=1043284392"]this[/URL] and [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1044652485&id=1043284385"]this[/URL]

Member Avatar for vbcielle
1
127
Member Avatar for ravi_forum
Member Avatar for shadowxgm

At least you have to try on your own. Then post your code to the forum explaining with which part you have a problem. Even if someone write the code for you the admin would remove it. [URL="http://www.daniweb.com/techtalkforums/announcement125-2.html"]please read this[/URL] Good luck

Member Avatar for andor
0
113
Member Avatar for insamd

[quote=isamd] [code] decToBin(name[i],2)=answer; [/code] [/quote] This is illegal. What did you want with this line?

Member Avatar for insamd
0
393
Member Avatar for Eddy Dean

[QUOTE=Eddy] [CODE] char buffer[2]; buffer[0] = 0x11; buffer[1] = 0x05; buffer[2] = 0x14; [/CODE] [/QUOTE] be carefull, the size of buffer is 2 bytes and U assigned 3 bytes so this is a bug.

Member Avatar for Eddy Dean
0
1K
Member Avatar for hay_man

You don't need double loop. What you need is one foor loop wich will print str[x] and [inlinecode]putchar(' ');[/inlinecode] if its [inlinecode]if (0 == (x % 4) && 0 != x)[/inlinecode]

Member Avatar for Ancient Dragon
0
235
Member Avatar for amelie
Member Avatar for squirrel

I will assume that you know to work with argc and argv. It should be simple just parse the string argv[2] till the '_' char and then copy what left (from '_' till the end including '\0') to temporary string. Then just use [CODE] if (strcmp(fileExtension, tempString) != 0) { …

Member Avatar for andor
0
110
Member Avatar for insamd

[CODE] #include <iostream> #include <cstdlib> #include <string> using namespace std; void decToBin(int number, int base); int main() { cout<<"Enter a string: "; string name; getline(cin,name); for (unsigned int i=0; i<name.size(); i++) { cout << name[i] << " binary ("; decToBin(name[i], 2); cout << ")" << endl; } return 0; } …

Member Avatar for insamd
0
86
Member Avatar for The Dude

Your Personality Profile [IMG]http://images.blogthings.com/worldsshortestpersonalitytest/green.jpg[/IMG] You are nurturing, kind, and lucky. Like mother nature, you want to help everyone. You are good at keeping secrets and tend to be secretive. A seeker of harmony, you are a natural peacemaker. You are good natured and people enjoy your company. You put people …

Member Avatar for sleepygamer
0
246
Member Avatar for jazzz

>> But there is some problem with the code can anyone help me? Some problem? Ok whats this iGetABCFile(char*)? You can't call functions like this You have bunch of variables wich are not declared like: ulNameRecordCount, usSubTypeCode, usSubTypeCode, usFeatureClassCode, aucAttributeType, ucFont. You try to fprintf them to file but not …

Member Avatar for jazzz
0
253
Member Avatar for star22

[QUOTE=star22]thank u my friend but I still find to error --------------------Configuration: zz - Win32 Debug-------------------- Compiling... zz.cpp c:\documents and settings\user\c++\zz.cpp(11) : error C2143: syntax error : missing ';' before '<class-head>' c:\documents and settings\user\c++\zz.cpp(11) : fatal error C1004: unexpected end of file found Error executing cl.exe. zz.exe - 2 error(s), 0 …

Member Avatar for andor
0
1K
Member Avatar for anupamjamatia
Member Avatar for bobradi

And the answer is: [CODE] ################################################### # author: Andor Pásztor ################################################### ################################################# # text segment # ################################################# .text .globl main main: la $a0, str1 li $v0, 4 syscall li $v0, 5 syscall or $t0, $v0, $v0 la $a0, str2 li $v0, 4 syscall li $v0, 5 syscall add $t1, $v0, …

Member Avatar for mostafadotnet
0
403
Member Avatar for sgriffiths

[QUOTE=sgriffiths]When i try to compile, i get this > gcc string_to_hex.c Undefined first referenced symbol in file itoa /tmp/cc21JKaJ.o ld: fatal: Symbol referencing errors. No output written to a.out collect2: ld returned 1 exit status[/QUOTE] Yes of course itoa is nonstandard. U can implement your own itoa [URL="http://www.daniweb.com/techtalkforums/showthread.php?t=11049&highlight=itoa"]http://www.daniweb.com/techtalkforums/showthread.php?t=11049&highlight=itoa[/URL] or use …

Member Avatar for Dave Sinkula
0
2K
Member Avatar for Tlhokomelo

the problem is [CODE] #define EOF =-1 [/CODE] [CODE] while ((c = getchar() !=EOF) // problem area :-( [/CODE] replace it with [CODE] #define EOF -1 [/CODE] [CODE] while ((c = getchar()) != EOF) // problem area :-( [/CODE]

Member Avatar for Salem
0
103
Member Avatar for sgriffiths

[CODE]#include<stdio.h> #include<stdlib.h> main() { FILE *fp; char buffer[]="STEPHEN"; fpos_t file_pos; char c; fp = fopen("ste.txt", "rb+" ); fseek(fp, 18, SEEK_SET ); fwrite(buffer, sizeof(buffer), 1, fp); fgetpos(fp, &file_pos ); printf("File Pos :%ld\n", file_pos ); c = getc(fp); printf("Character is : %c\n", c ); fclose(fp); [/CODE]

Member Avatar for sgriffiths
0
2K
Member Avatar for Ricky_v.s_C++

[QUOTE=Ricky_v.s_C++]How can I separate an integer into digits using for loop? eg. before: 123 after: 1 2 3 anyone can help me with that?[/QUOTE] Here is an idea. Convert to char *

Member Avatar for Ricky_v.s_C++
0
400
Member Avatar for mrjaiswal

This is just an idea how can solve your problem [CODE] #include "stdio.h" #include "pthread.h" pthread_t threadEvent; unsigned char breakLoop = 0; void * Exit(void * ptr) { char c = 'a'; scanf("%c", &c); if ( c == 'e') breakLoop = 1; } main() { int i = 0; pthread_attr_t …

Member Avatar for spaceboyz87
0
193
Member Avatar for ~s.o.s~

Why don't you use s[256] so you don't need malloc. Use gets for string input. To calculate spaces (if I understood your task) just iterate the input string example: if (s[index++] == 0x20) numSpaces++;

Member Avatar for Ancient Dragon
0
169
Member Avatar for bobradi
Member Avatar for andor
0
184
Member Avatar for niall

Compare it with yours and you will see the differences: [CODE] ################################################### # author: Andor Pásztor ################################################### .text .globl __start main: ##execution starts here #--------------------Start Cut--------------------- la $t1, str nextCh: lb $t2, ($t1) beqz $t2, strEnd addi $t4, $zero, 0x61 sub $t3, $t2, $t4 bgez $t3, l1 add $t2, $t2, …

Member Avatar for andor
0
6K
Member Avatar for kennethwcn

I have a question for you. Did you try to debug your code with SPIM simulator? If answer is no then try it.

Member Avatar for andor
0
329
Member Avatar for Braga_ESI

You mean functions? Try to find open source decoders (very hard process) wich decode the file and send the raw pcm data to audio device. Writing decoder on your own without experiance is insane. Wish you luck

Member Avatar for andor
0
67
Member Avatar for srishekh
Member Avatar for musicmancanora4
Member Avatar for harrypotter

Post the problem to linux forum or try to search the solution trought other linux forums (which will give you faster time to solve the problem). I'm sure that the problem occured to others.

Member Avatar for andor
0
66
Member Avatar for shaikh_mshariq

Use some editor to create example x.cpp. Then try to compile with g++ -o x x.cpp (without additional library) and run it with ./x command. Type this lines in console. If error occures then use google to check them. I think that knoppix has gcc and g++ included in it.

Member Avatar for andor
0
762
Member Avatar for c21ahongyi

[QUOTE=c21ahongyi]addi $t0, $s0,48 beq $t1, $t0, L1 L2: lw $t1, 16($t0) srl $t2, $t1,3 bne $t2, $t0, L2 L1: sw $t2, 32($t1) ori $s0, $s0, 0xFF7F j L1 if the machine code equivalent to the above MIPS codes is loaded in memory at starting address 0xd24fc91c, wat exact binary values …

Member Avatar for andor
0
122
Member Avatar for c21ahongyi

You can't load word [CODE]lw $t1, 5($s1)[/CODE] becouse 5 isn't divisable with 4 so you also can't do this [CODE]addi $s1, $s1, 11[/CODE] and then [CODE]lw $t3, -8($s1)[/CODE] the rest is correct so $t0 is 0xFFFFFF9d and $t2 is 0x000000fa. For learning MIPS you can use SPIM (yes revers from …

Member Avatar for andor
0
218
Member Avatar for coopedw

i'm not sure if I understood the problem but try to replace [CODE]if (num % fac == 0)[/CODE] with [CODE]if ((num % fac == 0) && (num != fac))[/CODE] and use this [CODE]void printPrimes (int num) { int number = 2; while(number <= num) { if (isPrime(number)) cout << number<<" …

Member Avatar for bumsfeld
0
220
Member Avatar for lette

You have errors what's this [CODE]private: int const ArraySize; int const [40]; int intConversion(char); void CopyArray( int[], const int[]);[/CODE] int const [40] :?: do you mean int number[40]. Try to fix the errors

Member Avatar for Bench
0
158
Member Avatar for egor

I need to write a program that takes in the values to a 4x5 two dimensional array of integers,then searches the array for values that are less than 0(zero)and displays these values along with there row and column indices.. Anyone have any ideas...newbie #include <stdio.h> #define MAX_ROW 5 #define MAX_COLUMN …

Member Avatar for dwks
0
106
Member Avatar for MillStrike

in first example counting the words at the begining of every word, in second example counting the words at following space (0x20). Try to add space after 'project'.

Member Avatar for Drowzee
0
172
Member Avatar for amt_muk

one of the way is cin.getline but you must specify the delimiter (maybe '.') [CODE] #include <iostream.h> void main() { char str[20]; cin.getline(str, 20, '.'); cout << str << endl; } [/CODE]

Member Avatar for Dave Sinkula
0
101
Member Avatar for Marack

Maybe U should try with switch . . . cin>>c; switch(c) { case 1: cout<<"Enter the number of dice to roll..."; cin>>n; cout<<"in groups of how many? "; cin>>g; D4(n,4); break; . . . default: cout<<"That is not a valid selection!\n"<<"\n"; break; } and also try to avoid globals

Member Avatar for andor
0
128
Member Avatar for Naveen

:lol: really u did it that no one cant yet now , really it is a amazing book for the c programmers bcoz in none of the book explain in this so simple way and the language is easy too.till i have read only 10 chapters, so i cna conclude …

Member Avatar for FireNet
1
292

The End.