-
Replied To a Post in Need a best c compiler for free download
Fantastic post Schol-R-LEA except that sockets are one of the few things you don't get through Windows.h you have to explicitly include WinSock2.h :p Also with some rather inverted logic … -
Began Watching strcpy not worked create my string
**WHY StrCpy - dosen't work normally :( ? Where is mistakes?** #include"string.c" int main() { printf("Hello World!\n"); char *text = "GOOOD TEXT ALL TIME VERY POOR "; int temp = … -
Replied To a Post in strcpy not worked create my string
Works fine for me using mingw 4.5.2 which is a c99 compiler. The only thing I would say is that the third line of `StrCpy` int size_destination = StrLen( destination … -
Began Watching Creating your own char **argv
Hello! Recently I've been working on a project which requires an API, the user supplies a function pointer which returns a specific value, this function needs a list of string … -
Replied To a Post in Creating your own char **argv
Line 11 `argv[i] = malloc(sizeof(temp));` or the modified form `argv[i] = malloc(sizeof(temp+1));` does not allocate enough memory. temp is a `char*` and has a fixed size 4 bytes (or maybe … -
Began Watching int vs char?
What's the difference between: int once; cout << "ok"; and this: char twice; cout << "ok"; Is the output for the first one just ok and the second one ok … -
Replied To a Post in int vs char?
> Char "is a simbol" found in ASCII code. Not really, ASCII is a way of encoding alaphbetic (and other) symbols as a number and defines numbers in the range … -
Began Watching two wire intercom using embedded c program in atmega8
plz help me..with the program for two wire intercom using embedded c program in atmega8 -
Replied To a Post in two wire intercom using embedded c program in atmega8
USART and SPI generally do different things and both tend to be 3 wire connections (because they require a ground). 2 wire connections tend to be used on a single … -
Began Watching 12 knights to dominate all squares of chess board 8x8
Hi I have to write program that finds a solution how to put 12 knights to a 8x8 chess board that every square would be dominated by one of the … -
Replied To a Post in 12 knights to dominate all squares of chess board 8x8
Understanding the problem is very import to this kind of problem because while you may have to brute force the final solution understanding the problem can help you reduce the … -
Began Watching TLE problem in c code
I wrote this code to find if string s2 is a substring of string s1. However I'm getting time limit exceeded. How can I make my algorithm better? #include<stdio.h> int … -
Replied To a Post in TLE problem in c code
At lines 21 and 35 you have used this construct `(*a)++` where `a` is a `char*`. Think about what this does ... Because of the \* in `(*a)++` you do … -
Began Watching IO write in middle of txt
My code right now: std::string line; std::fstream localFile; localINIFile.open(MyToReadFile/*, std::ios::in || std::ios::out*/); // the MyToReadFile is declared somewhere else, and is being declared before this if (localFile.is_open()) { std::string Name … -
Replied To a Post in IO write in middle of txt
Remeber a file is just a stream (or an array if you like) of characters. There are no lines that is just how some programs present the data to you, … -
Began Watching cannot use second vectoe
vector <int> a; //first vector vector <int> b; //second vector vector <int>::iterator i; //iterator for first vector vector <int>::iterator i1; //iterator for second vector //reading of first vector int temp; … -
Replied To a Post in cannot use second vectoe
When you type in that letter at line 9 cin enters an error state because it can not complete the requested operation, input a number. Additionally the letter you typed … -
Began Watching problem in using vector stl
for(i=a.begin();i!=a.end();i++) { cin>>*i; } for(i=a.begin();i!=a.end();i++) { cout<<*i; } above code works fine but when i use while loop to display vector , program crash. while(i!=a.end();) { cout<<*i; i++; } -
Replied To a Post in problem in using vector stl
What was i initialised to before the loop started? This should work i=a.begin(); while(i!=a.end()) { cout<<*i; i++; } -
Began Watching why doesn't the unsigned long long work?
it's a beginner's problem. I am trying to calculate sum of the first 15 factorials. I know int isn't large enough for the sum, so I used unsigned long long … -
Replied To a Post in why doesn't the unsigned long long work?
unsigned long long sum doesn't work because start is still an int. -
Began Watching malloc vs calloc
Can I please have a good detailed explanation on the differences between malloc and calloc? I always have trouble understanding that. -
Replied To a Post in malloc vs calloc
I've always said in C you should not cast the return value of malloc (or calloc). That is because if you leave out stdlib.h C will happily let you call … -
Began Watching How to extend the lifetime of a factory created object
Hi, The problem I am having is that the returned object, from a dll factory, is not lasting for more than the function scope that recieves it. Despite reading [How … -
Replied To a Post in How to extend the lifetime of a factory created object
It is hard to tell without seeing the definitions of g_spEngineLog and BOOSTSP although I am guessing from the name that it is a smart pointer defined by the Boost … -
Began Watching Things I hate about TV shows
Cop shows that include a 5 minute foot chase. This is usually the result of the cops shouting out a suspect's name from half a block away instead of waiting … -
Replied To a Post in Things I hate about TV shows
Seems we tend to get most irrate at the things we know and therefore stand out most to us as being wrong. A friend of mine who had been a … -
Replied To a Post in double and float
My best guess would be that 22.5 has an exact represenation as a double (and may be a float) and 22.7 doesn't. However that is not the point, you don't … -
Began Watching Large data type in c++
Is there a data type that can allow a user to input a 25 digit number... because the largest data type for numbers that i know is long long int … -
Replied To a Post in Large data type in c++
A 64bit integer is the largest native type currently in C++. However you are not the first person to have this problem and the way round it is to use … -
Began Watching c and double pointers
I am trying this: int test(int **a){ return **a; } int main(){ int p[2]={1,2}; int *a=&p[0]; int **d=&a[0]; //for (int i=0;i<2;i++) // printf("\na=%d\n",a[i]); //ok this works for (int i=0;i<2;i++) printf("\n%d … -
Replied To a Post in c and double pointers
In `int **d=&a[0];` d has type `int**` and a has type `int*`. The question is if a has type `int*` what is the type of the expression `&a[0]`? This isn't … -
Began Watching double and float
i have two different programs that compare float and double variales and gives output , i shown that below : 1. #include<stdio.h> main() { int r; float f=22.5; double d=22.5; … -
Replied To a Post in double and float
This is because floating point types (float, double, long double) only hold an approximation to the value you think they hold because of the way the value is encoded into … -
Began Watching A DOUBTFUL QUESTION..
can some one help me with this question.. "The name of students are sorted in an array of strings.Write a program to prepare alphabetically sorted listing of names.." -
Replied To a Post in A DOUBTFUL QUESTION..
Personally I would recomend the [Comb Sort](en.wikipedia.org/wiki/Comb_sort) algorithm rather than bubble sort which tends to be more efficient in the average case than Bubble sort but isn't that much more … -
Began Watching Get Items from map and add to a vector c++
I rote this code in my program JSONNode::const_iterator iter = root.begin(); for (; iter!=root.end(); ++iter) { const JSONNode& arrayNode = *iter; std::string type = arrayNode["type"].as_string(); if(type == "node") { std::string … -
Replied To a Post in Get Items from map and add to a vector c++
Instead of `collection[2].GetId()` use `collection.at(2).GetId()` the difference between these 2 calls is that calling `at` throws an exception if the index is out of range where using `[]` just does … -
Began Watching Fstream Output prob
**hey guys, well i just want to get alittle help on something, so this is my prob, i finally got the first .txt files to be made by spereating them … -
Replied To a Post in Fstream Output prob
Line 41 - 43 you output to the closed file `newemployee` instead of `dir` -
Began Watching C++ for loop error[help]
Hello, is this for loop possible? Im trying to get each new value for for(a;a<sum;a++) sum variable. After countless tries i am stuck and don't think it's possible to change … -
Replied To a Post in C++ for loop error[help]
I think you have a problem at lines 2 and 3 // for(a;a<sum;a++) { if(zaide[a] > 0) { The initial expression at line 2 `a` looks wrong, did you mean … -
Began Watching Thoughts, Poetry and Much More...
Hi All, I am starting this article so that we may share various motivational thoughts (your own creation will be great), poetry, short stories and all. This goes my own … -
Replied To a Post in Thoughts, Poetry and Much More...
1 from the section of my website that I call "Poetry (sort of)" The velociraptor of C++, was talking to a poet thus: the poet spoke, with some remorse, “It's … -
Stopped Watching How is the weather today in your country?
How is your weather in your country? I am living in the Philippines and the weather here today is stormy and according to news, we are overloaded of typhoons in … -
Began Watching column major not shown right
(Continued from [here](http://www.daniweb.com/software-development/cpp/threads/474128/column-major-not-shown-right#post2070227) ) I am trying to use column major order to a 2d matrix which I am using as 1d. int N=3,R=2; for (int i=0;i<N;i++){ for (int j=0;j<R;j++){ … -
Replied To a Post in column major not shown right
Yes, which every thing you are going to make major has to be the outside loop, the equation doesn't need changing. Think about how a 3 by 2 matrix is … -
Began Watching using of AT Commands
Dears, i was looking for a way to sommunicate with GSM modem through AT-Commands. am able to do that through HyberTerminal, but am stucked in converting that to C++, any … -
Replied To a Post in using of AT Commands
You will be very stuck if you can only use standard libraries because communication with a COM port is not part of the standard library and you normally have to … -
Began Watching LCD interfce problem.
I am trying to create Menu Selection process.if SELECT button pressed once should display the Display parameter and if select button pressed twice should goes to Set_parameter window(Where we set …
The End.